Repository navigation
fix(workboard): keep attachment deletion in its SQLite owner - #147191
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: needs maintainer review before merge. Reviewed September 13, 2026, 12:51 PM ET / 16:51 UTC. ClawSweeper reviewWhat this changesWorkboard card deletion stops rescanning attachments after SQLite cleanup and adds regression coverage for deletion, rollback, and concurrent card recreation. Merge readiness✅ Ready for maintainer review The fix remains necessary on reviewed main and v2026.9.4. The patch preserves transactional attachment cleanup, removes the recreation race, and has no identified blocking defect. Priority: P2 Review scores
Verification
How this fits togetherWorkboard stores task cards and their attachments in a plugin-owned SQLite database. Card deletion enters through the Workboard store, removes persisted card data, and then cleans up subscriptions and references. flowchart TD
A[Card deletion request] --> B[Workboard store]
B --> C[SQLite deletion transaction]
C --> D[Delete original attachment blobs]
D --> E[Delete card and cascade metadata]
E --> F[Clean subscriptions and references]
F --> G[Return deletion result]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -5, Tests +93. Total +88 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep attachment removal inside the existing SQLite card-deletion transaction, with recreated-card preservation covered at the store boundary. Do we have a high-confidence way to reproduce the issue? Yes, from source: pause after SQLite deletes a session card, recreate the same deterministic card ID on another connection, add an attachment, then resume the old cleanup. Tests were inspected but not executed during this read-only review. Is this the best way to solve the issue? Yes. Removing the redundant scan uses the existing transactional owner without adding a schema, migration, public API, or competing cleanup mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7bda807a35f9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…w#147191) Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Related: #146197
Deleting a Workboard card unnecessarily loads every other attachment and can remove new attachments if another connection recreates the same session card during cleanup.
User Impact
Card deletion preserves attachments added to a newly recreated card and avoids loading unrelated attachment bodies. Original attachment deletion, subscriptions and reference cleanup keep their existing owners.
Why This Change Was Made
SQLite already deletes the original attachment blobs and cascades their metadata in the card deletion transaction. Remove the obsolete later scan; it can only find unrelated attachments or newly recreated state.
Evidence
Native prepare, merge and cleanup completed at
8e854bc3c8013d1ad76c1ee4f8eda25648c12346. The original reviewed patch, the concurrent worker migration, and the independently landed awaited-cleanup fix were verified together on current main.Current-worker integration: after #146976, the same 100 unrelated 128 KiB attachments produced a 55.89→2.46 ms median deletion and 17,476,400→0 returned base64 payload bytes in an idle synthetic run. These are facade payload bytes, not native BLOB or wire-byte counts. The earlier timings above use the pre-worker implementation. The 173 selected store, lifecycle and Doctor tests passed. The awaited-cleanup correction landed independently in #147203; our identical #147227 was closed as a duplicate.