Repository navigation
refactor(push-web): move web push store to shared SQLite state DB - #103294
Conversation
aae9df0 to
c944c73
Compare
3dd3ae0 to
9abf67f
Compare
9abf67f to
1e06a0d
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs real behavior proof before merge. Reviewed July 14, 2026, 12:01 PM ET / 16:01 UTC. Summary PR surface: Source +302, Tests +169. Total +471 across 6 files. Reproducibility: yes. at source level: two concurrent subscription mutations can load the same snapshot and replace each other, and two first-use VAPID callers can generate different pairs before either persistence result is authoritative. No live concurrent-race transcript was provided. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Use row-level transactional subscription mutations and an atomic insert-or-read VAPID helper, settle whether legacy import is doctor-owned or an explicitly approved startup exception, then demonstrate both fresh and upgrade behavior through an exact-head gateway run. Do we have a high-confidence way to reproduce the issue? Yes at source level: two concurrent subscription mutations can load the same snapshot and replace each other, and two first-use VAPID callers can generate different pairs before either persistence result is authoritative. No live concurrent-race transcript was provided. Is this the best way to solve the issue? No. Moving the state to SQLite is appropriate, but the maintainable solution needs row-level transactional mutations, atomic VAPID creation, and an explicitly approved migration owner rather than whole-table snapshot replacement plus an undecided startup failure contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8251976cf6c7. Label changesLabel justifications:
Evidence reviewedPR surface: Source +302, Tests +169. Total +471 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (9 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
ef783c8 to
fcadb17
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
c926268 to
33eacb9
Compare
f25949d to
5e1c847
Compare
713004b to
e2840fc
Compare
e2840fc to
c23b6f3
Compare
Co-authored-by: hailory <[email protected]>
|
Merged via squash.
|
Closes #108399
What Problem This Solves
Web Push subscriptions and the generated VAPID signing identity still lived in whole-store JSON files. Concurrent Gateway processes could lose registrations or create competing identities, and upgrades had no verified path into the canonical shared database.
Why This Change Was Made
This rewrites the contributor PR around typed shared-SQLite rows and synchronous row-level transactions. Explicit
openclaw doctor --fixrepair now takes exclusive state ownership, validates and claims both retired files before one atomic import, verifies the committed rows, and removes only verified claims. Runtime has no JSON fallback and fails closed for registration, delivery, deletion, and key resolution while a retired source or interrupted Doctor claim remains.Thanks @xydt-tanshanshan for the original SQLite migration direction and implementation work.
User Impact
Web Push registrations and VAPID identity now survive concurrent updates without whole-file lost writes. Existing JSON state is preserved through an explicit, retry-safe Doctor migration; operators must stop the Gateway before the upgrade repair. Expired-subscription cleanup remains best-effort so a cleanup failure cannot make callers retry notifications that were already delivered.
Release-note context: Web Push state now uses shared SQLite. On upgrades with retired
push/vapid-keys.jsonorpush/web-push-subscriptions.json, stop the Gateway and runopenclaw doctor --fixbefore using Web Push.Evidence
main: passed (run).Regression coverage includes concurrent registration and first-use key generation, compare-and-delete expiry races, pending-legacy runtime gates, cleanup failure and retry, missing/empty legacy VAPID subjects, malformed/conflicting stores, symlink and path-race confinement, source claiming and restoration, interrupted claims, and live-Gateway exclusion.