Bound planning sync history and reject expired offline edits #381

Closed
opened 2026-08-09 07:30:50 +00:00 by rockachopa · 0 comments
Member

Problem

Today and Later operation receipt tables grow without bound. A read-only benchmark produced about 5.3 MB per 100,000 receipts in each ledger, increasing long-running disk, backup, and SQLite lookup costs. Browser queues also have no explicit supported offline age.

Vertical slice

  • Add migratable receipt timestamps and a per-account retention cap to Today and Later stores.
  • Prune in the same successful write transaction without affecting another account.
  • Include a base revision on Today operations so a receipt pruned later cannot make an ancient replay mutate newer server state.
  • Expire browser operations older than the documented horizon with visible conflict status instead of silently replaying them.
  • Preserve Later per-item conflict protection and document the retention contract.

Acceptance tests

  1. Receipt rows remain bounded per account and another account is untouched.
  2. Retained operation IDs stay idempotent.
  3. A pruned stale Today operation is rejected and cannot change a newer plan.
  4. Existing SQLite schemas migrate without losing plans or receipts.
  5. Ancient browser queue entries are removed and surfaced as conflicts; fresh entries still sync.
  6. Full test suite and Gitea Actions pass.
## Problem Today and Later operation receipt tables grow without bound. A read-only benchmark produced about 5.3 MB per 100,000 receipts in each ledger, increasing long-running disk, backup, and SQLite lookup costs. Browser queues also have no explicit supported offline age. ## Vertical slice - Add migratable receipt timestamps and a per-account retention cap to Today and Later stores. - Prune in the same successful write transaction without affecting another account. - Include a base revision on Today operations so a receipt pruned later cannot make an ancient replay mutate newer server state. - Expire browser operations older than the documented horizon with visible conflict status instead of silently replaying them. - Preserve Later per-item conflict protection and document the retention contract. ## Acceptance tests 1. Receipt rows remain bounded per account and another account is untouched. 2. Retained operation IDs stay idempotent. 3. A pruned stale Today operation is rejected and cannot change a newer plan. 4. Existing SQLite schemas migrate without losing plans or receipts. 5. Ancient browser queue entries are removed and surfaced as conflicts; fresh entries still sync. 6. Full test suite and Gitea Actions pass.
timmy was assigned by rockachopa 2026-08-09 07:30:50 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stackchain/stackchain-dashboard#381
No description provided.