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
Commit 390e1b3
Browse filesBrowse the repository at this point in the historyBrowse files
fix(copilot): bound resource-write locks and repair reorder persistence
Review follow-ups on the saved-view pinning work.
Correctness:
- Reorder persistence was parked by ANY pending write. A repeatedly failing
update to an already-stored resource (a view pin) blocked tab ordering for
the rest of the session; gate on unpersisted writes only, which are the
ones the server's identity check can actually reject.
- A parked reorder body that the server rejects was re-parked verbatim, so a
tab closed after the order was captured poisoned it permanently. Discard on
400; keep retrying everything transient.
- adoptScope merged the provisional and chat-scoped updates in the wrong
order, letting an older pending write overwrite a newer one.
- A view pin that arrived before the table finished its first adoption was
dropped for good when the table data resolved after the views list. The
stream path self-rescued through query invalidation; the restore path did
not. Re-run the effect when adoption becomes possible.
- Reordering a chat holding a legacy duplicate row 400'd forever. Compare
identity sets so the duplicate collapses on write instead.
- mergeChatResource aliased the caller's object into React state, the query
cache and the pending-write queue at once. Copy it.
Robustness:
- The new copilot_chats FOR UPDATE transactions had no lock_timeout, and
neither the pool nor the deployment sets one. finalizeAssistantTurn holds
that same row across an assistant-message append, so a waiter could park a
pool connection indefinitely. Bound all five writers.
- mergeChatResource's field list is now one declaration that fails to compile
when MothershipResource gains a field, rather than silently dropping it
from both the merge and its no-op check.
- Extraction can no longer emit viewId and clearViewId together, a pair the
wire contract rejects and the merge would resolve to neither.
- Restrict the eager view-id URL write to embedded tables, leaving standalone
table behaviour identical to staging.
- Drop the queue's unreachable unscoped bucket, its uncalled clear(), and its
test-only getPendingUpdates().
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FwmaLmAXSK2hsPBGZmkPnT
0 commit comments