feat(ios): reconcile restored cache as stale until a live snapshot - #441
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
One or more issues must be addressed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds explicit stale/recovering/live liveness handling for restored iOS workspace state, gates mutations, and adds stale-recovery UI coverage.
Changes:
- Marks restored/disconnected workspace data stale until an authoritative snapshot arrives.
- Blocks stale workspace mutations and remote controls.
- Adds stale-recovery fixtures, accessibility coverage, and reconciliation tests.
File summaries
| File | Description |
|---|---|
| native/ios/PsycheCore/Tests/PsycheCoreTests/WorkspaceStoreTests.swift | Updated as part of this pull request. |
| native/ios/PsycheCore/Tests/PsycheCoreTests/WorkspaceStoreCommandsTests.swift | Updated as part of this pull request. |
| native/ios/PsycheCore/Sources/PsycheCore/State/WorkspaceStore.swift | Updated as part of this pull request. |
| native/ios/PsycheCore/Sources/PsycheCore/Fixtures/WorkspaceFixtures.swift | Updated as part of this pull request. |
| native/ios/PsycheApp/Tests/PsycheAppUITests/PsycheAppUITests.swift | Updated as part of this pull request. |
| native/ios/PsycheApp/Sources/PsycheApp/Views/PaneControls.swift | Updated as part of this pull request. |
| native/ios/PsycheApp/Sources/PsycheApp/Views/NowView.swift | Updated as part of this pull request. |
| native/ios/PsycheApp/Sources/PsycheApp/DemoStore.swift | Updated as part of this pull request. |
Review details
Suppressed comments (1)
native/ios/PsycheApp/Sources/PsycheApp/Views/PaneControls.swift:203
- This check only protects the initial menu tap. The async task below can run after a disconnect marks the store stale, and
RemoteActionStore.start/responddo not consultWorkspaceStore.liveness; an already-open action sheet can therefore still sendstartActionorrespondToActionagainst stale workspace state. Recheck the shared liveness authority at the async send/response boundary and invalidate pending action sessions when the store becomes stale.
guard store.liveness.allowsLiveActions else {
errorMessage = WorkspaceStoreError.staleWorkspace.localizedDescription
return
}
- Files reviewed: 8/8 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Bead psyche-i7c.10.2 (mirror #211) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bead psyche-i7c.10.2 (mirror #211) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bead psyche-i7c.10.2 (mirror #211) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When disconnect is called during an existing teardown, await that teardown before returning so callers do not immediately attempt stored reconnect while the manager is still disconnecting and later observe the old disconnected final state instead of the refused-readiness failure. References: Bead psyche-i7c.10.2 (mirror #211); outcome #200 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
BunsDev
force-pushed
the
feat/ios-stale-live-reconciliation
branch
from
September 11, 2026 15:49
7ff49c8 to
84b1105
Compare
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
Acceptance criteria
WorkspaceLiveness.staleon cache restore;testRestoredCacheIsPresentedAsStaleUntilAuthoritativeSnapshotArrives;testStaleFixtureShowsDisabledControlsThenClearsAfterLiveSnapshottestRestoredCacheIsPresentedAsStaleUntilAuthoritativeSnapshotArrives;testAuthoritativeSnapshotRecoversSavingAndDismissalKeepsPreservedDatacovered in app teststestDisconnectKeepsStateButMarksItStale; new mutation guard coverage intestEveryMutationCommandRefusesStaleWorkspaceBeforeSendingandtestRefusesRitualLaunchWhileWorkspaceIsStalecached-panetolive-panewithout carrying stale draftsCommands and results
git show --stat 3f104272xcodebuild test -project native/ios/Psyche.xcodeproj -scheme PsycheCore -destination 'platform=iOS Simulator,name=iPhone 16 Pro' -only-testing:PsycheCoreTests/WorkspaceStoreTests -only-testing:PsycheCoreTests/WorkspaceStoreCommandsTests -derivedDataPath /tmp/psyche-core-targetedxcodebuild test -project native/ios/Psyche.xcodeproj -scheme PsycheApp -destination 'platform=iOS Simulator,name=iPhone 16 Pro' -only-testing:PsycheAppTests/AppModelTests -only-testing:PsycheAppTests/CreatePaneFormTests -only-testing:PsycheAppTests/PaneComposerTests -derivedDataPath /tmp/psyche-app-targetedxcodebuild test -project native/ios/Psyche.xcodeproj -scheme PsycheApp -destination 'platform=iOS Simulator,name=iPhone 16 Pro' -only-testing:PsycheAppUITests/PsycheAppUITests/testStaleFixtureShowsDisabledControlsThenClearsAfterLiveSnapshot -derivedDataPath /tmp/psyche-ui-targeted3xcodebuild test -project native/ios/Psyche.xcodeproj -scheme PsycheCore -destination 'platform=iOS Simulator,name=iPhone 16 Pro' -derivedDataPath /tmp/psyche-core-fullpnpm ios:project:checkgit diff --checkxcodebuild -versionxcodebuild test -project native/ios/Psyche.xcodeproj -scheme PsycheApp -destination 'platform=iOS Simulator,name=iPhone 16 Pro' -derivedDataPath /tmp/psyche-app-full-2xcodebuild test -project native/ios/Psyche.xcodeproj -scheme PsycheApp -destination 'platform=iOS Simulator,name=iPhone 16 Pro' -parallel-testing-enabled NO -derivedDataPath /tmp/psyche-app-full-serialMach error -308 - (ipc/mig) server diedafter app connection loss/restarts on iOS 26.5 simulator runtimeProof gaps
PsycheAppUI target did not complete locally because the simulator runner repeatedly lost the app/helper connection on the available iOS 26.5 runtime. The new stale-recovery UI test passed in isolation.Rollback
Revert commit
e566fb444097682efa556a69f55e7551969af899to remove the liveness enum, mutation gate changes, stale-recovery fixture, and associated tests.References
Bead psyche-i7c.10.2 (mirror #211); outcome #200