Drain Today edits queued during an in-flight sync #367

Closed
opened 2026-08-09 03:29:39 +00:00 by rockachopa · 0 comments
Member

User problem

On mobile, a user can add, remove, or reorder a second Today item while the first Today PATCH is still in flight. The second flush() shares the first promise, but frontend/today-sync.js currently iterates a one-time queue snapshot, so the later edit remains device-only until an unrelated lifecycle event.

Evidence

frontend/today-sync.js snapshots pending() before its for loop. The adjacent Later synchronizer re-reads and drains its queue in a while loop. Historical issues #357, #361, and #365 cover baseline synchronization, revision convergence, and retry after failures, but not edits queued during a successful in-flight flush.

Acceptance criteria

  • A Today edit enqueued while a PATCH is blocked is delivered in FIFO order before the shared flush settles.
  • Stable operation IDs are preserved and each successful operation is delivered once.
  • A 409 removes only the rejected operation and later queued edits continue draining.
  • An account change stops the prior account drain without deleting another account's queue.
  • The updated mobile shell is cache-versioned and focused plus full tests pass.
## User problem On mobile, a user can add, remove, or reorder a second Today item while the first Today PATCH is still in flight. The second `flush()` shares the first promise, but `frontend/today-sync.js` currently iterates a one-time queue snapshot, so the later edit remains device-only until an unrelated lifecycle event. ## Evidence `frontend/today-sync.js` snapshots `pending()` before its `for` loop. The adjacent Later synchronizer re-reads and drains its queue in a `while` loop. Historical issues #357, #361, and #365 cover baseline synchronization, revision convergence, and retry after failures, but not edits queued during a successful in-flight flush. ## Acceptance criteria - A Today edit enqueued while a PATCH is blocked is delivered in FIFO order before the shared flush settles. - Stable operation IDs are preserved and each successful operation is delivered once. - A 409 removes only the rejected operation and later queued edits continue draining. - An account change stops the prior account drain without deleting another account's queue. - The updated mobile shell is cache-versioned and focused plus full tests pass.
timmy was assigned by rockachopa 2026-08-09 03:29:39 +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#367
No description provided.