Repository navigation
fix: prevent stale sharing updates after connection switches - #116837
Conversation
c9c3ac6 to
0ae5013
Compare
|
Codex review: needs changes before merge. Reviewed July 31, 2026, 8:46 AM ET / 12:46 UTC. ClawSweeper reviewWhat this changesThe branch captures the initiating Gateway connection for Control UI session visibility and membership mutations, discarding stale success, refresh, reload, and error handling after the operator switches gateway or account. Merge readinessKeep this PR open for a narrow release-process correction: the connection-scoped mutation fix and focused regression coverage address the linked Control UI race, but the PR should not edit the release-owned changelog. The member-authored, Priority: P2 Review scores
Verification
How this fits togetherControl UI sharing controls send session visibility and membership mutations to the active Gateway, then refresh the session list and sharing cache. Because operators can replace the Gateway connection while those requests are pending, completion code must only update the connection that started the operation. flowchart LR
A[Operator changes session sharing] --> B[Control UI sharing mutation]
B --> C[Capture active Gateway connection]
C --> D[Gateway visibility or membership request]
D --> E{Captured connection still active?}
E -->|Yes| F[Refresh sessions and sharing cache]
E -->|No| G[Discard stale result or error]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +16, Tests +366, Docs +1. Total +383 across 3 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Retain the scoped connection-fencing implementation and its focused regression tests, but remove the release-owned Do we have a high-confidence way to reproduce the issue? Yes from source and focused test design: start a delayed visibility or membership mutation on connection A, replace the active connection with B, then resolve or reject A and assert that B receives no stale refresh, reload, or error update. Is this the best way to solve the issue? Yes, aside from the changelog edit. Capturing the initiating connection and checking it after each asynchronous phase keeps the ownership boundary at the mutation path and matches the existing guarded sharing-load behavior. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c50a6119efcf. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
0ae5013 to
2f80f87
Compare
|
Merged. What changed after review:
Verification:
Landed on
Thanks @shakkernerd! |
Closes #116800
What Problem This Solves
Fixes an issue where users changing session visibility or membership could see stale sharing state or errors when the Control UI switched to another gateway or account while the mutation was still in flight.
Why This Change Was Made
Sharing mutations now remain bound to the gateway connection that initiated them and discard stale results after every asynchronous mutation, refresh, and reload phase. Existing success ordering and current-connection error behavior remain unchanged.
User Impact
Operators can switch gateways or accounts without an earlier connection's sharing mutation refreshing or overwriting the replacement connection's session state.
Evidence
run_62e5c5e1a70b.run_a31c9183ad82.