Skip to content

fix: always replay the current todo list on session/load - #71

Merged
william0wang merged 1 commit into
mainfrom
fix/load-plan-replay
Aug 22, 2026
Merged

fix: always replay the current todo list on session/load#71
william0wang merged 1 commit into
mainfrom
fix/load-plan-replay

Conversation

@william0wang

Copy link
Copy Markdown
Owner

Problem

A re-attaching client (the mobile app always re-attaches via
session/load) never learned a session's current todo list: the shared
per-session differ only emits PlanUpdate on plan CHANGE, and its
lastPlanSig was already aligned by whatever client attached first —
the second load's diff came back empty.

Fix

  • Keep running the shared differ's full diff for its mark-seen side
    effect
    (turn completion must not re-emit replayed history), but
    discard its events.
  • Emit the CURRENT todos through a throwaway differ whose
    "__none__" sentinel makes diffPlan always fire — every load now
    carries the plan, changed or not.

Testing

  • tests/load-plan-replay.test.ts: a second loadSession on the same
    session still emits a PlanUpdate with the current entries. Verified to
    fail without the fix (stash → red, pop → green).
  • Full suite: 689/689 passed; typecheck/lint/build clean.
  • Version 0.11.5 + CHANGELOG.

@william0wang
william0wang merged commit d998268 into main Aug 22, 2026
@william0wang
william0wang deleted the fix/load-plan-replay branch August 22, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant