You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(session): a window opened while an install starts shows it as running - #2145
TL;DR: a Desktop window that opens while a ComfyUI install starts or stops now shows that install's state correctly.
Why When a window opens, its builds list reads the running installs, then four more lists, and only then starts listening for "started" and "stopped" messages. An install that starts or stops during those reads is missed, and that window stays wrong until the app restarts. A running install shows as "Ready" with a Start button. Picking it launches it again instead of switching to its window. The macOS end-to-end test "Instance B (running elsewhere): focus its existing window" hit this on its first try in both CI runs of #2134. It opens a second window and marks B as running about 2 seconds later, while that window can still be loading on a cold CI Mac.
Before / After
Before: sessionStore.init() subscribed to the install events after its five hydration reads. After: it subscribes first, then reads. Each read only adds entries and reflects main's state at the time of the reply, so an event that arrives first is not undone.
Two new unit tests send a "started" and a "stopped" event while init() is still waiting on its reads.
Seen in production by: no user report found; CI found it (#2134, E2E (macos 3/3), e2e/nav-matrix-instance.test.ts:105).
Run: pnpm exec vitest run src/renderer/src/stores/sessionStore.test.ts on an Apple silicon Mac, 34 of 34 passed. Against the old sessionStore.ts, both new tests fail. Not run: the end-to-end suite, which CI runs; the CI failure did not happen on this Mac in 40 local runs, so the e2e evidence is #2134 going green after this merges.
Rule bent: none.
Ref DESK-305
Video: E2E_VIDEO=1 pnpm exec playwright test e2e/nav-matrix-instance.test.ts --project=macos on this PR's head, 2 of 2 passed. Top row: the two Desktop windows. Bottom row: their two build pickers; the second picker shows Nav Inst B as running (green dot) after the test marks it running, and picking it switches to B's window.
Review was skipped as selected files did not have any reviewable changes.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 5b95df30-f190-499a-a19e-a62a5d26d82e
Commits
Reviewing files that changed from the base of the PR and between 8bc4cee and 69d0123.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
Session initialization now registers IPC listeners before restoring running, launching, stopping, active-operation, and crash state. Added tests verify that instance start and stop events received during hydration are reflected alongside the running-instance snapshot.
Changes: Session hydration
Layer / File(s)
Summary
Register listeners before restoring state src/renderer/src/stores/sessionStore.ts
init now registers listeners before restoring the existing state snapshots and crash entries.
Test lifecycle events during hydration src/renderer/src/stores/sessionStore.test.ts
Tests verify that an instance-started event for inst-2 is retained alongside snapshot instance inst-1, and that an instance-stopped event for inst-1 leaves it not running after hydration.
This change fixes a startup race where an install that started or stopped during hydration could appear as "Ready" and launch a second time. No actionable merge-blocking risk was found. The new tests cover the start and stop cases.
Pre-merge checks: 2
Check name
Status
Explanation
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Simplify code
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 8348f61f-d357-46e0-90bb-f3a12df09e26
Commits
Reviewing files that changed from the base of the PR and between 5a3c71b and 8bc4cee.
Files selected for processing: 2
src/renderer/src/stores/sessionStore.test.ts
src/renderer/src/stores/sessionStore.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
@benceruleanlu could you review this one? It's a two-file renderer fix: a window now starts listening for install started/stopped before it reads the running list. It's also the cause of the macOS e2e failure blocking #2134.
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.
TL;DR: a Desktop window that opens while a ComfyUI install starts or stops now shows that install's state correctly.
Why When a window opens, its builds list reads the running installs, then four more lists, and only then starts listening for "started" and "stopped" messages. An install that starts or stops during those reads is missed, and that window stays wrong until the app restarts. A running install shows as "Ready" with a Start button. Picking it launches it again instead of switching to its window. The macOS end-to-end test "Instance B (running elsewhere): focus its existing window" hit this on its first try in both CI runs of #2134. It opens a second window and marks B as running about 2 seconds later, while that window can still be loading on a cold CI Mac.
Before / After
sessionStore.init()subscribed to the install events after its five hydration reads. After: it subscribes first, then reads. Each read only adds entries and reflects main's state at the time of the reply, so an event that arrives first is not undone.init()is still waiting on its reads.Seen in production by: no user report found; CI found it (#2134,
E2E (macos 3/3),e2e/nav-matrix-instance.test.ts:105).Run:
pnpm exec vitest run src/renderer/src/stores/sessionStore.test.tson an Apple silicon Mac, 34 of 34 passed. Against the oldsessionStore.ts, both new tests fail. Not run: the end-to-end suite, which CI runs; the CI failure did not happen on this Mac in 40 local runs, so the e2e evidence is #2134 going green after this merges.Rule bent: none.
Ref DESK-305
Video:
E2E_VIDEO=1 pnpm exec playwright test e2e/nav-matrix-instance.test.ts --project=macoson this PR's head, 2 of 2 passed. Top row: the two Desktop windows. Bottom row: their two build pickers; the second picker shows Nav Inst B as running (green dot) after the test marks it running, and picking it switches to B's window.nav-matrix-instance-macos-2145.mp4