Skip to content

chore: update to firebase_functions 0.6.0#1282

Open
brianquinlan wants to merge 1 commit intofirebase:dart-launchfrom
brianquinlan:bq-dart-update
Open

chore: update to firebase_functions 0.6.0#1282
brianquinlan wants to merge 1 commit intofirebase:dart-launchfrom
brianquinlan:bq-dart-update

Conversation

@brianquinlan
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the firebase_functions dependency to version 0.6.0 and replaces the fireUp initialization with runFunctions across several Dart quickstart projects. The review feedback identifies that the upgrade to 0.6.0 introduces breaking changes to the onCall handler signature and the removal of CallableResult that have not been addressed in the code. Furthermore, it is recommended to use await runFunctions in the main entry points to ensure proper lifecycle management of the server.

Comment on lines +49 to +50
void main() {
runFunctions((firebase) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The update to firebase_functions 0.6.0 introduces breaking changes that are not fully addressed in the function handlers:

  1. onCall Signature: The handler now takes a single CallableRequest argument. The response object is now a property of the request object. You must update line 52 to (request) async { and line 76 to await request.response.sendChunk(result);.
  2. CallableResult Removal: This class has been removed in 0.6.0. You should return the result directly (e.g., return await Future.wait(allRequests); on line 86).
  3. Async Main: It is recommended to await runFunctions to ensure the entry point correctly handles the server's lifecycle.
Suggested change
void main() {
runFunctions((firebase) {
void main() async {
await runFunctions((firebase) {

Comment on lines +20 to +21
void main() {
runFunctions((firebase) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The update to firebase_functions 0.6.0 requires updates to the onCall handler signature and return type:

  1. onCall Signature: The handler on line 25 should be updated to take only one argument: (request) async {. The response argument is no longer passed separately.
  2. CallableResult Removal: The CallableResult wrapper on line 60 should be removed, and the map should be returned directly. Remember to also remove the closing parenthesis on line 65.
  3. Async Main: Consider using await runFunctions for better lifecycle management.
Suggested change
void main() {
runFunctions((firebase) {
void main() async {
await runFunctions((firebase) {

Comment on lines +41 to +42
void main() {
runFunctions((firebase) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It is recommended to await runFunctions to ensure the entry point handles the server's future correctly, even if the event loop keeps the process alive.

Suggested change
void main() {
runFunctions((firebase) {
void main() async {
await runFunctions((firebase) {

Comment on lines +13 to +14
void main() {
runFunctions((firebase) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It is recommended to await runFunctions to ensure the entry point handles the server's future correctly.

Suggested change
void main() {
runFunctions((firebase) {
void main() async {
await runFunctions((firebase) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant