Repository navigation
fix(performance): retry failed CPU and FPS closes instead of blocking new sessions - #67
Merged
Merged
Conversation
… new sessions A close failure during stop left the panel's cleanup promise rejected forever, so retry, device selection and reconnects never opened another session. Cleanup now waits for prior work with allSettled and reports only the current stop's failure. A session stays current until its close succeeds, so the next stop or open retries the close before starting another collector.
When a stop or device switch happened during session creation, the late session was closed once and dropped if that close failed. The panel now owns the session as soon as it opens, and both panels close any session they still own before opening another collector.
lauridskern
marked this pull request as ready for review
October 29, 2026 15:00
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.
If a CPU or Display FPS session close failed, the panel's cleanup promise stayed rejected for good. Retry, device switches and reconnects then failed without opening a new session.
Now
stop()waits for earlier work withPromise.allSettled, keeps a cleanup promise that never rejects, and still reports its own close failure so the panel shows it. A session stays owned until its close succeeds. That includes a session that finishes opening after a stop or device switch. Before either panel opens another collector, it closes any session it still owns. A failed close stays visible and blocks the new session until a later retry succeeds, so collectors never overlap. FPSretry()and device selection wait on their own stop, like CPUrestart(). Each action makes one close attempt.Tests, with a mock host:
show().The new tests fail before the fix.
node --test "packages/ui/test/*.test.ts" "packages/shared/test/*.test.ts": 428 passed.Telemetry is unchanged. The UI tool-call wrapper records a span and outcome for every close attempt, retries included, and reports failures with
captureUiError.