Repository navigation
refactor(matrix): adopt core claimable dedupe with doctor-owned state migration - #104391
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 6:32 AM ET / 10:32 UTC. Summary PR surface: Source +125, Tests +34, Docs +5. Total +164 across 15 files. Reproducibility: yes. source-level reproduction is high confidence: fill Matrix sibling namespaces to the 50,000-row plugin fuse while leaving dedupe-namespace room, retain an older canonical dedupe row, then import a missing legacy marker; overflow prunes the canonical row from the writing namespace. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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
Security Review findings
Review detailsBest possible solution: Keep the core claimable-dedupe runtime, but import legacy markers through an atomic non-evicting operation that preserves existing canonical rows under both namespace and plugin-wide limits, with saturated-state regression coverage and real Matrix upgrade proof. Do we have a high-confidence way to reproduce the issue? Yes, source-level reproduction is high confidence: fill Matrix sibling namespaces to the 50,000-row plugin fuse while leaving dedupe-namespace room, retain an older canonical dedupe row, then import a missing legacy marker; overflow prunes the canonical row from the writing namespace. Is this the best way to solve the issue? No, not yet: adopting shared claimable dedupe is the narrowest maintainable runtime solution, but the one-time importer must first guarantee that existing canonical rows cannot be evicted at either capacity boundary. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8917dac5ded4. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +125, Tests +34, Docs +5. Total +164 across 15 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
|
|
Merged via squash.
|
… migration (openclaw#104391) * refactor(matrix): adopt core claimable dedupe for inbound events * fix(matrix): migrate legacy inbound dedupe markers via doctor * fix(matrix): single-pool dedupe namespace and capacity-aware legacy import * fix(matrix): keep unreadable legacy dedupe JSON in place during doctor import
Related: #104318
What Problem This Solves
Matrix maintained a 312-LOC hand-rolled inbound event deduper (own SQLite shape, eager startup loads, runtime legacy-JSON import) parallel to the core claimable dedupe used by eleven other channels. Replay protection is load-bearing on Matrix: /sync replays after unclean shutdown and async decrypt re-emission make duplicates routine.
Why This Change Was Made
The storage machinery moves onto core
createClaimableDedupe(claim → commit-on-reply-success → release), matrix supplying only its (account, room, event) key derivation. Because this store is durable duplicate-side-effect protection (not a droppable cache), shipped state migrates via a one-time doctor-owned migration covering both shipped sources: ≥2026.6 SQLite rows and ≤2026.5inbound-dedupe.json(verified live on shipped tags). Import preserves remaining 30-day TTL, is capacity-aware (never evicts newer runtime commits), retires sources only on success, and is idempotent. Single global namespace with account-scoped keys so the plugin-state capacity fuse composes safely (telegram's shipped shape). Runtime module: 100 LOC vs 312.User Impact
No steady-state change; upgrades keep replay protection intact across the transition (no duplicate replies from post-upgrade /sync replays).
Evidence
tbx_01kx8agy63syhd2ca9bgtz6tcv: matrix monitor + doctor-contract suites 488 tests green (incl. pre-upgrade SQLite+JSON rows deduping post-migration through the real runtime guard, TTL expiry skip, retirement+idempotence, capacity preservation, malformed-JSON archival) + fullpnpm check:changed(incl. database-first legacy-store guard).plugin-state-store.sqlite.ts; final run clean — "patch is correct (0.88)".