test(desktop): isolate the Suggested tasks feedback owner authority - #12650
Conversation
`SuggestedTasksStoreTests.testNotMineAndAlreadyHandledPersistReasonAndResolveCandidate` is one of the flakes tracked in BasedHardware#12039. It failed in CI on an unrelated backend PR with: ("nil") is not equal to ("Optional(…TaskIntelligenceFeedbackReason.not_mine)") The store resolves two owner authorities. `suppressionStore` was injected, but `feedbackOutboxStore` was left on the default `SuggestedFeedbackOutboxDefaults`, whose owner is process-global: fixedOwnerID ?? defaults.string(forKey: .authUserId) ?? "signed-out" `dismiss` re-checks owner currency *after* awaiting the backend reject. Any other suite in the same binary that writes `auth_userId` while that await is suspended flips the owner, so `dismiss` returns early without recording feedback — the assertion above sees an empty `api.feedback`. 34 other test files touch that key, which is why the failure tracks suite order rather than anything in this suite. 27 of the 37 store constructions in this file were half-isolated this way; the other 10 already injected a `MemoryFeedbackOutboxStore` because they assert on outbox contents. All 37 now pin both owners to the suite, which is the same repair BasedHardware#12192 and BasedHardware#12259 made for the Rewind and FloatingBar owner authorities. `testDismissSurvivesAGlobalAuthOwnerFlipAtTheAwaitedRejectPoint` pins the contract. It drives the flip through the existing `onReject` hook — the exact suspension point — so the hazard is deterministic rather than order-dependent. Verification: 40/40 in this suite; 99/99 with the owner and auth suites that write `auth_userId` in one process. Mutation-checked: dropping the `feedbackOutboxStore` injection from the new test reproduces CI's failure byte for byte, `("nil") is not equal to ("Optional(Omi_Computer.OmiAPI.TaskIntelligenceFeedbackReason.not_mine)")`, and restoring it returns green. This is one leg of BasedHardware#12039. `KernelTurnRecordedProjectionTests` remains open; the chat gesture, Rewind owner, and FloatingBar owner legs landed in BasedHardware#12406, BasedHardware#12192 and BasedHardware#12259. Failure-Class: none
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Thanks @aryanorastar — verified end to end; this is a clean piece of test-infrastructure repair. Production seam (verified in The change ( On the red required checks: they are not from this change. The only failing suite out of 749 was Leaving for human maintainer review only for the merge call: someone needs to sign off on merging while a required check is red from an unrelated flake. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
…asks-owner-isolation
What
SuggestedTasksStoreTestsis one of the flaky suites tracked in #12039. This isolates its feedback owner authority, which is what made it order-dependent.The defect
SuggestedTasksStoreresolves two owner authorities. The tests injected one and left the other global:SuggestedFeedbackOutboxDefaults.currentOwnerID()is process-global:dismissre-checks owner currency after awaiting the backend reject:Any other suite in the binary that writes
auth_userIdwhile that await is suspended flips the feedback owner,dismissreturns early, andapi.feedbackstays empty — which is exactly the CI failure on an unrelated backend PR:34 other test files touch
auth_userId, so the failure tracks suite order rather than anything in this suite.The fix
27 of the 37 store constructions in this file were half-isolated. The other 10 already injected a
MemoryFeedbackOutboxStore, because they assert on outbox contents — so the seam existed and was simply not used consistently. All 37 now pin both owners to the suite.This is the same repair #12192 and #12259 made for the Rewind and FloatingBar owner authorities.
Guard
testDismissSurvivesAGlobalAuthOwnerFlipAtTheAwaitedRejectPointpins the contract. It drives the owner flip through the existingonRejecthook — the precise suspension point — so the hazard is reproduced deterministically instead of by suite order.Verification
auth_userIdin one process (AuthRefreshResilienceTests,RuntimeOwnerIdentityTests,AuthSessionAttemptFenceTests,EffectiveOwnerDatabaseBoundaryTests,TasksStoreOwnerBoundaryTests,FloatingOwnerProjectionTests,RewindStorageTestIsolation).feedbackOutboxStoreinjection from the new test reproduces CI's failure byte for byte:Restoring the injection returns green.
Scope
One leg of #12039.
KernelTurnRecordedProjectionTestsremains open. The chat-gesture, Rewind-owner and FloatingBar-owner legs landed in #12406, #12192 and #12259.Tests only — no production code changes.
Failure-Class: none