Repository navigation
fix(client): reconcile pending delivery after execution - #59877
kernel-oops wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
This fixes the stale pending state described in #59615 at the client-state level. I copied the PR's tests onto the base branch: the 4 new ones fail there and pass here, and the full packages/client suite passes (242 tests). tsc --noEmit passes too. I didn't check this in the live TUI, because it needs missed SSE events.
Public API: unchanged. These are internal changes to the Solid data store only.
One regression worth fixing before merge: clearing the outbox guard as soon as session.prompt resolves lets an older inbox snapshot that is still in flight drop a prompt that is still pending. Details are inline.
This also overlaps with #58072, which edits the same outbox handling in data.ts and the same test file in another way. Whichever lands second will need to reconcile the two.
Related: #56748
| }, | ||
| gate, | ||
| ).catch((error) => { | ||
| ).then((item) => { |
There was a problem hiding this comment.
Clearing outbox here lets an older pending.sync that is still in flight drop this prompt. invalidate only queues a reload behind the current read. If that read started before the server admitted the prompt, its snapshot doesn't include it. When it lands, inflight no longer keeps the row, because the guard is gone, so the queued card disappears until the follow-up read brings it back.
I reproduced this with a small fixture: start pending.sync, resolve the prompt POST, then resolve the older read with []. input.list goes ["msg_local"] → [] → ["msg_local"]. On the base branch it stays ["msg_local"] throughout.
The guard should only be lifted for a read that starts after the acknowledgement. For example, record the acknowledged ID and let only a sync that started later drop it. Clearing it before that older read finishes is what causes the drop.
Issue for this PR
Closes #59615
Type of change
What does this PR do?
Revalidate a known or in-flight inbox snapshot at an execution boundary and after a successful prompt admission when its enqueue echo was missed. This clears stale pending state while retaining genuinely pending items, unacknowledged submissions and existing snapshot/event race handling.
How did you verify your code works?
59542dae3c882e4cf9b029c83de508fffd797487, three focused regression tests failed before the change; afterwards, 81 affected client tests passed and client typecheck passed.Process.getBuiltinModulemissing. The same diagnostic was reproduced on the unchanged public base in a local fixture; this is not a claim about upstream CI.Visual
No new visual design or UI layout change.
Screenshots / recordings
No live screenshot or recording is available. The client-state regression is covered by the deterministic tests above.
Checklist
Added by the opencode bot (AI-generated).
Related: #56748