Fix quit and macOS last-window lifecycle#144
Merged
Merged
Conversation
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.
Summary
MessagePortclients, which do not expose a native remote-close eventMessageChanneltestsRoot cause
The quit guard asks the renderer for settled document state, which serializes behind pending workspace edits. When a workspace sync port was replaced or lost, the channel kept its request promise pending because only explicit local disposal rejected calls.
AppLifecycletherefore remained inconfirming, and subsequent quit attempts were ignored as an already-running guard.This is a follow-up to #87, which introduced the dirty-document close guard and requires fast close after an edit to settle safely.
Impact
Workspace or renderer port teardown now becomes an observable channel failure. Close and quit flows can recover or fail instead of waiting indefinitely, and
DocumentClient.connectedno longer reports a remotely closed lane as live. Closing all windows on macOS now preserves the normal document-app lifecycle without changing Windows or Linux quit behavior.Validation
pnpm --filter @shift/desktop test(44 files, 500 tests)pnpm --filter @shift/desktop typecheckpnpm --filter @shift/desktop lint:checkpnpm format:checkpython3 scripts/context-drift-check.pystill reports 22 pre-existing repository documentation errors unrelated to this change.