Repository navigation
fix(cli): bound Telemetry.shutdown so unreachable PostHog endpoint cannot block CLI exit #9807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
markijbema
merged 8 commits into
Kilo-Org:main
from
truffle-dev:fix/cli-best-effort-telemetry-shutdown-on-exit-9788
Jun 17, 2026
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5f16547
fix(cli): bound Telemetry.shutdown so unreachable PostHog endpoint ca…
truffle-dev 2723c08
test(telemetry): isolate shutdown timeout test in its own file
truffle-dev e93a65c
Merge branch 'main' into fix/cli-best-effort-telemetry-shutdown-on-ex…
549725b
fix(cli): preserve successful exit when telemetry times out
0f2fc6f
test(cli): cover rejected telemetry shutdown
9394100
chore: add telemetry shutdown changeset
9b12e1c
test(cli): avoid global runtime mock
f59a0f1
Merge branch 'main' into fix/cli-best-effort-telemetry-shutdown-on-ex…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WARNING: Static import prevents the PostHog mock from replacing the client under test
This file imports
Telemetrybeforemock.module("posthog-node", ...)runs, which also loads../client.jsand binds it to the realPostHogimport. The later dynamic imports return the cached modules, soClient.init()will not use this fake class and the test can either hit the real client or fail to assert the intended shutdown call. Move the telemetry/client imports into the test after the mock is registered (and remove this top-level import) so the mockedposthog-nodeis the dependency used byClient.init().