Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a notification during the function release process to inform users that Dart functions might not yet be visible in the Firebase Console, providing a link to the Cloud Console instead. The review feedback suggests using the isLanguageRuntime utility instead of runtimeIsLanguage to avoid the use of non-null assertions on the runtime property, which aligns with the project's style guide regarding strict null checks.
| printTriggerUrls(wantBackend, projectNumber); | ||
|
|
||
| // TODO: Remove once the Firebase console has support. | ||
| if (backend.someEndpoint(wantBackend, (endpoint) => runtimeIsLanguage(endpoint.runtime!, "dart"))) { |
There was a problem hiding this comment.
Use isLanguageRuntime to safely check the runtime. This avoids the use of the non-null assertion operator (!), which can lead to runtime errors if runtime is undefined. This change adheres to the repository's best practices for explicit null handling.
| if (backend.someEndpoint(wantBackend, (endpoint) => runtimeIsLanguage(endpoint.runtime!, "dart"))) { | |
| if (backend.someEndpoint(wantBackend, (endpoint) => isLanguageRuntime(endpoint.runtime, "dart"))) { |
References
- Use strict null checks and handle undefined/null explicitly. Avoid using non-null assertions as escape hatches. (link)
kevmoo
left a comment
There was a problem hiding this comment.
I don't understand the code well, but the message is right on!
Alternate to #10235