Keep Week Ahead plans through offline saves #1180

Closed
opened 2026-08-20 13:27:41 +00:00 by timmy · 0 comments
Owner

Problem

The newly shipped Week Ahead flow sends a full-week PUT directly, closes the planner before network delivery completes, and retains conflicts only in memory. On an unreliable phone connection, a seven-day plan can disappear after reload; reopening after a 409 also clears the local version despite copy claiming both versions are preserved. Tomorrow already has durable account-bound staging, but Week Ahead does not.

Product slice

Make Week Ahead saves durable-first and account-bound. Restore pending plans after reload, flush single-flight on reconnect/foreground, preserve local and server versions across a 409, and let the operator explicitly keep the phone week or use the account week. Pending/conflicting weeks must not auto-promote into Today.

Acceptance

  • Saving a complete week offline is admitted to device storage before the planner reports success and shows sync pending.
  • The same confirmed account restores every date, item order, estimate, capacity, timezone, and base revision after reload; another account cannot see it.
  • Reconnect/foreground performs one in-flight PUT and clears local state only after a matching server receipt.
  • A 409 preserves both complete versions across reopen and offers Keep this phone / Use account actions.
  • Repeated 409 refreshes the remote side without losing the phone version.
  • Pending or conflicted weeks cannot promote into Today.
  • Focused behavioral tests, the full suite, and packaged mobile Week Ahead tests pass.

Non-duplication evidence

Historical issue/PR audit found Week Ahead only in #1177/#1179 (online planning and in-memory conflict capture). Offline durability and conflict recovery exist only for Tomorrow in #1160/#1164. Current frontend/week-plan.js has no storage/getLogin staging path and adopt() clears lastConflict. No open issue is eligible or covers this behavior.

## Problem The newly shipped Week Ahead flow sends a full-week PUT directly, closes the planner before network delivery completes, and retains conflicts only in memory. On an unreliable phone connection, a seven-day plan can disappear after reload; reopening after a 409 also clears the local version despite copy claiming both versions are preserved. Tomorrow already has durable account-bound staging, but Week Ahead does not. ## Product slice Make Week Ahead saves durable-first and account-bound. Restore pending plans after reload, flush single-flight on reconnect/foreground, preserve local and server versions across a 409, and let the operator explicitly keep the phone week or use the account week. Pending/conflicting weeks must not auto-promote into Today. ## Acceptance - [ ] Saving a complete week offline is admitted to device storage before the planner reports success and shows sync pending. - [ ] The same confirmed account restores every date, item order, estimate, capacity, timezone, and base revision after reload; another account cannot see it. - [ ] Reconnect/foreground performs one in-flight PUT and clears local state only after a matching server receipt. - [ ] A 409 preserves both complete versions across reopen and offers Keep this phone / Use account actions. - [ ] Repeated 409 refreshes the remote side without losing the phone version. - [ ] Pending or conflicted weeks cannot promote into Today. - [ ] Focused behavioral tests, the full suite, and packaged mobile Week Ahead tests pass. ## Non-duplication evidence Historical issue/PR audit found Week Ahead only in #1177/#1179 (online planning and in-memory conflict capture). Offline durability and conflict recovery exist only for Tomorrow in #1160/#1164. Current `frontend/week-plan.js` has no storage/getLogin staging path and `adopt()` clears `lastConflict`. No open issue is eligible or covers this behavior.
timmy self-assigned this 2026-08-20 13:27:41 +00:00
timmy closed this issue 2026-08-20 13:57:05 +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#1180
No description provided.