Skip to content

🐛 Fix diff tracking: hydrate bootstrap + clear stale current_diff#66

Merged
Robdel12 merged 2 commits intomainfrom
mission/robdel12-orbitdock#62
Mar 22, 2026
Merged

🐛 Fix diff tracking: hydrate bootstrap + clear stale current_diff#66
Robdel12 merged 2 commits intomainfrom
mission/robdel12-orbitdock#62

Conversation

@Robdel12
Copy link
Owner

Summary

  • Bootstrap hydration gap: handleConversationBootstrap discarded current_diff, current_plan, turn_diffs, current_turn_id, and turn_count from the server payload because SessionDetailSnapshotProjection didn't include them. Review panel showed empty diffs after connect/reconnect.
  • Stale current_diff: Server never cleared current_diff after TurnCompleted, leaving the same diff in both sessions.current_diff and turn_diffs. Now cleared in transition state, persistence, and emitted via SessionDelta.

Changes

File What
SessionStore+Events.swift Hydrate diff/plan/turnDiffs/turn tracking from bootstrap state
connector-core/transition.rs Clear current_diff after archiving into turn_diffs; emit clearing in SessionDelta; updated test
persistence/mod.rs Clear sessions.current_diff in DB when inserting turn diff

Test plan

  • All 313 Rust tests pass (make rust-ci)
  • All Swift unit tests pass (make test-unit)
  • Manual: open review panel for a session with completed turns — diffs should appear immediately (not after a WS event)
  • Manual: complete a turn, verify current_diff clears in real-time on the review panel

Closes #62

Bootstrap snapshots included diff/turnDiffs/plan data on the wire but
handleConversationBootstrap never applied them to the SessionObservable.
This caused the review panel to show empty diffs after connect/reconnect.

Also clears current_diff on TurnCompleted so it only represents
in-progress state, not stale data from the last completed turn.
@Robdel12 Robdel12 merged commit c13165a into main Mar 22, 2026
3 checks passed
@Robdel12 Robdel12 deleted the mission/robdel12-orbitdock#62 branch March 22, 2026 13:37
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.

🔬 Scope and debug diff tracking for conversations and review

1 participant