Repository navigation
fix: prevent analytics timeouts from masking command exit codes - #11258
Merged
Merged
Conversation
ajperel
added this pull request to stack #11259
October 10, 2026 00:21
ajperel
commented
Oct 10, 2026
Contributor
There was a problem hiding this comment.
Code Review
This pull request ensures that analytics tracking timeouts or failures do not mask command errors or cause successful commands to exit with an error. It wraps the tracking logic in try-catch blocks, logs tracking failures as debug messages, sets the process exit code appropriately on command failures, and adds comprehensive unit tests. The review feedback suggests standardizing on undefined over null for the exit code types in the new tests to align with the repository's style guide.
ajperel
force-pushed
the
ajp/command-exit-code
branch
from
October 10, 2026 00:36
a484f43 to
227468b
Compare
ajperel
force-pushed
the
ajp/command-exit-code
branch
from
October 10, 2026 00:38
227468b to
792cc32
Compare
ajperel
force-pushed
the
ajp/command-exit-code
branch
from
October 12, 2026 16:10
792cc32 to
c58c7a7
Compare
ajperel
force-pushed
the
ajp/command-exit-code
branch
from
October 12, 2026 17:29
c58c7a7 to
463a272
Compare
ajperel
force-pushed
the
ajp/command-exit-code
branch
from
October 12, 2026 17:33
463a272 to
8a44d08
Compare
### Description Wraps post-command analytics tracking (`withTimeout(5000, Promise.all(tracks))`) in `try / catch` blocks (restoring the guard from #10253 that was inadvertently reverted in #10270) so telemetry timeouts cannot skip `client.errorOut(err)` on command failure or cause successful commands to fail. Partially addresses #6989. ### Scenarios Tested - Manually tested with `firebase deploy --only functions`. - Unit tests in `src/command.spec.ts` verifying `client.errorOut` is called when analytics tracking times out on command failure and is not called when analytics tracking times out on command success. ### Sample Commands ```bash firebase deploy --only functions ```
ajperel
force-pushed
the
ajp/command-exit-code
branch
from
October 12, 2026 21:41
8a44d08 to
b5c4bc7
Compare
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Wraps post-command analytics tracking (
withTimeout(5000, Promise.all(tracks))) intry / catchblocks (restoring the guard from #10253 that was inadvertently reverted in #10270) so telemetry timeouts cannot skipclient.errorOut(err)on command failure or cause successful commands to fail.Partially addresses #6989.
Scenarios Tested
firebase deploy --only functions.src/command.spec.tsverifyingclient.errorOutis called when analytics tracking times out on command failure and is not called when analytics tracking times out on command success.Sample Commands