Skip to content

fix(ui-react): preserve newer principal outcome after cancellation - #3116

Closed
schlessera wants to merge 1 commit into
mainfrom
as/work-issue-3093
Closed

schlessera wants to merge 1 commit into
mainfrom
as/work-issue-3093

Conversation

@schlessera

@schlessera schlessera commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Closes #3093

What changed

Cancellation now revalidates the captured queue entry after deletion succeeds or fails. A newer principal transition keeps its Signed out outcome, and the forgotten cancellation cannot send an orphan status query or install a cancelled receipt entry. Includes a patch changeset for @schlessera/brain-ui-react.

Why this shape

Entry identity is the existing authority check used by takeover. Principal changes settle and forget an entry without changing the lifecycle epoch, so both cancellation continuations need the same narrow check. No terminal ranking, tombstones, queue policy or protocol change.

Proof

  • Base: a8e80eea1ec045579ee7d69d6019bce5e78afa5e.
  • Added four controlled memory-storage schedules: deletion success/failure across same/different-principal reconnect. Each joins the actual cancellation promise; different-principal cases require the original Signed out outcome, no held/persisted answer, no transport effects and no accepted receipt overriding it. Same-principal controls require normal cancellation or failed-delete recovery and the exact status query.
  • Failing first: complete manager file, 69 pass / 2 fail. Success overwrites Signed out with Cancelled; failed deletion replaces the newer settled outcome.
  • Independent mutations remove only the success or failure continuation guard. Each named different-principal test fails at the preserved-outcome assertion; the same-principal control passes. Failed-delete mutation also changes settlement time by 100 ms.
  • Restored: bun run test packages/ui-react/tests/answer-delivery.test.ts: 71 pass / 0 fail, 351 assertions. Existing cancel/Edit, deletion failure, accepted receipt, logout and disposal cases remain.
  • bun scripts/check-changeset-packages.ts and full bunx --no-install changeset status pass; pending plan has the all nineteen packages moving at minor through the existing fixed group, with no major bump.
  • Local bun run check:pr --base origin/main passed: 443 tests, 0 failures, 1,375 assertions; lint/leakage, env docs and changeset checks passed. Hosted candidate proof pending.
  • Head: de24256249aacbe0e64950eb37521503c90c48a0. Synthetic candidate: 1324d9f39688db99fad2d36e4d41ac5ba28cb54b, parents base a8e80eea1ec045579ee7d69d6019bce5e78afa5e / head de24256249aacbe0e64950eb37521503c90c48a0, tree b95560762672af770dbae7daaef8eb0af729a60b; live main/base read back equal before confirmation.
  • These controls prove manager causation only. No native IndexedDB/socket scheduling or historical incident attribution is claimed. Initial test invocation could not load uninstalled workspace dependencies; frozen copyfile install resolved setup before behavioral proof.

Checklist

  • Focused preflight and complete selected hosted proof passed.
  • Scoped implementation and manager acceptance checks are complete.
  • PR and issue release milestones read back as 0.45.0 before qualification.
  • Consumer-visible patch changeset included.
  • Public-text and tree leakage checks applied.
  • Machine surfaces and provider history unchanged.
  • Existing documented cancellation/principal semantics preserved; cited source line positions unchanged.

Anything left open

Hosted qualification is blocked on the live integration reservation for PR #3115; bounded acquisition for this PR exited 1 without requesting confirmation. Resume after that reservation is released, revalidating live main/head/merge parents before acquiring the exact candidate. Issue claim released; preserved branch and PR remain resumable. #3030 explicitly excludes this separate repair from the 0.44.0 commitment; release context will use the live 0.45.0 milestone without modifying that release scope or executing a release.

@schlessera schlessera added type: fix Something is broken and must behave the way it is documented. area: ui-react React chat/files/voice components, stores, WebSocket transport. labels Oct 29, 2026
@schlessera schlessera added this to the 0.45.0 milestone Oct 29, 2026
This was referenced Oct 29, 2026
This was referenced Nov 14, 2026
@schlessera

Copy link
Copy Markdown
Owner Author

Superseded by #4046. That PR carries this branch's single commit (de2425624) cherry-picked unchanged onto current main, with the failing-first and mutation receipts re-run and a fresh check:pr receipt. The approach still matches the issue and the current cancel source. Branch as/work-issue-3093 is left in place.

@schlessera schlessera closed this Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui-react React chat/files/voice components, stores, WebSocket transport. type: fix Something is broken and must behave the way it is documented.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui-react: cancellation deletion can override a newer signed-out outcome

1 participant