Repository navigation
fix(ui): report scoped snapshot transaction failures - #173553
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c32af4af6a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for (const event of ["complete", "error", "abort"]) { | ||
| transaction.addEventListener(event, () => resolve(), byPrefix ? { once: true } : undefined); | ||
| } | ||
| void transactionComplete(transaction).then(resolve, reject); |
There was a problem hiding this comment.
Catch scoped-clear rejections in retirement paths
When IndexedDB aborts during credential retirement or a warm-boot scope mismatch, this newly rejecting promise is reached through void clear(...) in ui/src/app/gateway-store.credentials.ts:91-94 or void clearWarmBootState(...) in ui/src/app/bootstrap-warm-boot.ts:131-134; neither caller attaches a rejection handler. The failure therefore becomes an unhandled promise rejection rather than a controlled report, while the scoped records remain uncleared. Catch and log the failure at these fire-and-forget boundaries, or keep this cleanup best effort.
AGENTS.md reference: AGENTS.md:L81-L81
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR makes account-scoped snapshot deletion reject failed IndexedDB transactions while preserving best-effort single-session eviction. Example: An IndexedDB transaction aborts while clearing cached conversations for account-a at wss://cache.example.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: it fixes a current silent-failure bug, but the new rejection escapes two fire-and-forget cleanup callers. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Control UI snapshot cache receives account-scoped invalidations from credential retirement and warm boot, deletes matching IndexedDB records, and returns a completion promise to its callers. flowchart TD
A[Credential retirement] --> C[Warm boot cleanup]
B[Account scope mismatch] --> C
C --> D[Snapshot invalidation]
D --> E[IndexedDB deletion transaction]
E --> F[Completion or rejection]
Technical reviewBest possible solution: Keep strict scope-clear rejection and handle failures at both background cleanup callers without delaying synchronous boot-record retirement. Do we have a high-confidence way to reproduce the issue? Source establishes that main resolves aborted deletions and that this PR propagates rejection into two unchecked callers; the author reports a failing-before, passing-after storage regression, but no code was executed during this read-only review. Is this the best way to solve the issue? Reusing transactionComplete is the appropriate small repair, provided its newly rejecting result is handled at every affected background caller. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1bd533dfc7e4. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource -2, Tests +64. Total +62 across 2 files. Added test files: 1. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 15, 2026, 7:49 PM ET / 23:49 UTC. |
## What Problem This Solves An aborted IndexedDB transaction could report that an account-scoped chat snapshot clear succeeded, even though its cached records remained. ## User Impact Explicit scope clearing now reports transaction errors. Ordinary single-session cache eviction remains best effort. No schema, rendered UI, config, or protocol changes. ## Why This Change Was Made Use the existing transaction completion owner instead of treating complete, error, and abort as equivalent success events. The narrow regression uses a real IndexedDB transaction abort and verifies the record was not deleted. ## Best-effort tradeoffs accepted - Single-session eviction remains intentionally best effort; explicit scope clearing rejects on failure. No new best-effort concession is introduced. The swallowed transaction outcomes originated in openclaw#162428 and survived openclaw#167780/openclaw#168206; the regression demonstrates the bug without claiming a human incident. Net production LOC: **2 removed**. This is a silent-failure bug fix, exempt from the cleanup batch floor. ## Evidence - Before repair: the scope-clear regression failed because its promise resolved instead of rejecting; the single-session control passed. - After repair: 23 tests passed across the new invalidation regression and the existing snapshot store suite. New regression bodies: 6 ms; loaded-host wrapper: 167.37 s (Vitest 112.44 s). - Formatting and `git diff --check` pass. - Independent P0-P2 review found no issue in this packet. The complete multi-packet review found one unrelated MCP diagnostic issue, corrected separately. - Targeted production and regression graph typecheck passes, including after the fixture lint repair. Runtime import cycles: zero. Production import edges are unchanged, so this cut cannot add a static import component. The full madge scan was stopped after30minutes without a result; no full static scan pass is claimed. - Changed-file check: conflict-marker and line-cap gates pass. Max-lines itself passed but its combined command failed on inherited environment-count ratchet drift (452 variables, budget453). The subsequent broad assertion scan was deliberately stopped after the aggregate command exceeded20minutes; no passing aggregate check is claimed. - Lint-suppression test:2/3 pass, existing inventory mismatch96vs94 in untouched `ui/src/test-helpers/control-ui-streaming-reply.ts` (no-unnecessary-type-conversion and unbound-method, two each). No baseline/suppression changes. Exact-head hosted CI remains the broad gate. - Targeted source-backed lint found one unbound-method reference in the regression. The fixture now binds the native method to its test database; no suppressions were added. The fixed graph typecheck and affected two-case regression pass (120.26s wrapper /71.77s Vitest; bodies435ms). No fixed-head lint pass is claimed; exact-head hosted lint is required before merge. The change does not modify rendering; behavior is proved at the IndexedDB boundary. Exact-head hosted CI run38824831588 completed with the ci-gate successful; no failed jobs, CI reruns, dispatches or green-only pushes. Hosted lint supplies the fixed-fixture lint gate. Earlier draft-only skipped CI is not counted as proof.
What Problem This Solves
An aborted IndexedDB transaction could report that an account-scoped chat snapshot clear succeeded, even though its cached records remained.
User Impact
Explicit scope clearing now reports transaction errors. Ordinary single-session cache eviction remains best effort. No schema, rendered UI, config, or protocol changes.
Why This Change Was Made
Use the existing transaction completion owner instead of treating complete, error, and abort as equivalent success events. The narrow regression uses a real IndexedDB transaction abort and verifies the record was not deleted.
Best-effort tradeoffs accepted
Net production LOC: 2 removed. This is a silent-failure bug fix, exempt from the cleanup batch floor.
Evidence
git diff --checkpass.ui/src/test-helpers/control-ui-streaming-reply.ts(no-unnecessary-type-conversion and unbound-method, two each). No baseline/suppression changes. Exact-head hosted CI remains the broad gate.The change does not modify rendering; behavior is proved at the IndexedDB boundary.
Exact-head hosted CI run38824831588 completed with the ci-gate successful; no failed jobs, CI reruns, dispatches or green-only pushes. Hosted lint supplies the fixed-fixture lint gate. Earlier draft-only skipped CI is not counted as proof.