FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Adding default timeout for dart functions by shettyvarun268 · Pull Request #10501 · firebase/firebase-tools · GitHub

Adding default timeout for dart functions - #10501

Merged
shettyvarun268 merged 8 commits into
mainfrom
dart-default-timeout
May 13, 2026
Merged

Adding default timeout for dart functions#10501
shettyvarun268 merged 8 commits into
mainfrom
dart-default-timeout

Conversation

shettyvarun268 commented May 12, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Fixes: #10487

This PR refactors the handling of default timeouts for functions deployed to the Cloud Run platform (such as Dart functions). To improve maintainability, it introduces a dedicated resolveDefaultTimeout method in the Firebase CLI (src/deploy/functions/prepare.ts) to apply a 60-second default timeout to all functions with platform: "run" if not specified, matching the expectation set by Node.js functions.

Additionally, the PR preserves existing timeouts for already deployed functions. If a function is already live in the cloud, the CLI will keep that timeout if the local code does not specify a new one, rather than overriding it with the new default.

Comprehensive unit tests have been added to prepare.spec.ts and updated in index.spec.ts to verify these behaviors, and all existing tests passed successfully.

gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Code Review

This pull request introduces a default timeout of 60 seconds for Dart functions when not running in the emulator and ensures that GCFv2 endpoints are correctly mapped to the "run" platform. Comprehensive unit tests were added to verify these behaviors under various conditions. The review feedback identifies several violations of the repository style guide regarding the use of "any" as a type escape hatch in the new test file, recommending the use of proper interfaces or specific type assertions instead.

shettyvarun268 marked this pull request as ready for review May 12, 2026 20:00

Copy link
Copy Markdown
Contributor Author

/gemini review

gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Code Review

This pull request implements a default timeout of 60 seconds for Dart functions when not explicitly configured, applicable only when not running in the emulator. The changes include logic within the Dart runtime delegate to apply this default and ensure the platform is correctly set to 'run' for GCFv2 functions, supported by new unit tests verifying these behaviors and the preservation of user-defined timeouts. I have no feedback to provide.

wandamora left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM % small nit

Comment thread CHANGELOG.md

ajperel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for the quick work. A few more nits.

Comment thread src/deploy/functions/prepare.ts Outdated
shettyvarun268 merged commit 6203955 into main May 13, 2026
78 of 81 checks passed
shettyvarun268 deleted the dart-default-timeout branch May 13, 2026 17:15
bkendall pushed a commit that referenced this pull request Jul 9, 2026
* Adding default timeout for dart functions

* fix: resolve lint errors and remove any casts in tests

* Adding change log

* changelog

* Addressing reviews

* Rehauling the logic to handle all functions deployed as run

* Modularize resolveDefaultTimeout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Default timeout for Dart functions is not 60 seconds

4 participants


Back | FazBrowse Home | New Git URL