Repository navigation
fix(desktop): keep a surfaced terminal outage across focus and remount - #8981
Draft
posthog[bot] wants to merge 2 commits into
Draft
posthog[bot] wants to merge 2 commits into
posthog[bot] wants to merge 2 commits into
Conversation
During an outage the terminal had already diagnosed, every window focus, tab switch (park + connect) or wake reset the failure budget and the telemetry latch. The header hid the cause for about 10 more failed dials, and terminal_connect_failed fired again for the same outage. Now a resume or a same-endpoint remount keeps the budget, the diagnosis and the latch when the outage was already surfaced. A resume before any diagnosis still starts a fresh budget, so failures counted while suspended do not flag an outage. A different endpoint, a terminated session or a manual reconnect still resets everything. Generated-By: PostHog Desktop Task-Id: 88981d8a-cfec-49ad-b97d-c9e51164dbbe
Contributor
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
Generated-By: PostHog Desktop Task-Id: 88981d8a-cfec-49ad-b97d-c9e51164dbbe
Contributor
🚀 Preview Deployment🔗 Preview Links
Preview updates automatically with new commits |
This branch was previously deployed
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.
What & why
Problem
terminal_connect_failedlatch, so one continuous outage sends the event again after each focus or tab switch. A few stuck terminals produce most of the events. The failure-to-input ratio in the report measures focus events more than outages.Changes
forceReconnect) or a remount on the same endpoint (connectafterpark) keeps the failure count, the diagnosis and the telemetry latch. The redial still happens at once. If it attaches,attachedclears everything as before. If it fails, the cause shows again after the first failure, not after 10 more.disconnect()and the manualreconnect()still reset everything.Note
After this change,
terminal_connect_failedcounts outages more closely. Expect event volume to drop with no change in the number of affected people. Compare people affected, not raw events, against the old baseline.Agent context
stream-blocked. It needs relay-side logs. Also not in scope: host-offline and relay-unreachable failures that reflect real host or network state. The header already explains those.How I tested it
bun test src/renderer/lib/terminal/inapps/desktop: all tests pass, including 4 new transport tests (resume before diagnosis, resume during an outage, remount on the same endpoint, remount on a new endpoint). The 2 "keeps the outage" tests fail onmain.bunx @biomejs/biome@2.4.2 checkon the changed files andbun run typecheckinapps/desktoppass. I did not run the rootbun run lint(the full repo script).lastDiagnosisand the log entries.Checklist
type(scope): subject)bun run lintandbun run typecheckpass (CI fails on lint warnings too)Created with PostHog Desktop from this inbox report.
Origin
signals-scout-generalSummary by cubic
Keeps a diagnosed terminal outage visible and single-report across window focus, tab switches, and wake events, instead of resetting the failure budget and telemetry latch each time.
forceReconnect) or a remount on the same endpoint during a diagnosed outage now keeps the diagnosis, failure count, and telemetry latch; the cause returns after the first failed redial instead of after ~10.disconnect(), and manualreconnect()still reset everything as before.terminal_connect_failednow tracks outages rather than focus events, so event volume drops with no change in affected people.Written for commit 1ca2b93. Summary will update on new commits.