fix(gateway): make /compress failure-safe #534

Closed
opened 2026-10-27 13:36:42 +00:00 by sam · 0 comments
Owner

applyCompress swallows MessageCount and DeleteRecentMessages errors (allCount, _ := and _, _ =) then deletes all messages BEFORE saving the compressed replacement. A crash or error between the two loses the session's entire history unrecoverably. Add a store-level ReplaceMessages that saves first and deletes the previously-listed IDs after, so the failure mode is recoverable duplicates rather than total loss.


Imported from beads archie-core-1786637489857-3-24abe68c · GitHub #24 · type task · priority P2 · created 2026-08-08 · closed 2026-08-08

applyCompress swallows MessageCount and DeleteRecentMessages errors (allCount, _ := and _, _ =) then deletes all messages BEFORE saving the compressed replacement. A crash or error between the two loses the session's entire history unrecoverably. Add a store-level ReplaceMessages that saves first and deletes the previously-listed IDs after, so the failure mode is recoverable duplicates rather than total loss. --- _Imported from beads `archie-core-1786637489857-3-24abe68c` · GitHub #24 · type task · priority P2 · created 2026-08-08 · closed 2026-08-08_
sam added the mediumtask labels 2026-10-27 13:36:42 +00:00
sam self-assigned this 2026-10-27 13:36:42 +00:00
sam closed this issue 2026-10-27 13:36:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#534