Session Sync Repair

Nucleic-Session: 0C7BC346-0002-4533-ADDD-3B4C92E58527
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-05 04:29:53 -07:00
co-authored by Nucleic
parent a27477d662
commit 628f26bdfb
@@ -35,7 +35,20 @@ final class HostConnection {
/// The session RemoteStore currently has open on this host, if any — so snapshot/events are only
/// forwarded (and deduped) for the transcript on screen. Set by RemoteStore on open/close.
var openSessionID: SessionID?
/// Changing which session is open resets the per-session cursor + dedup set (they only make
/// sense within one transcript).
var openSessionID: SessionID? {
didSet {
guard openSessionID != oldValue else { return }
openMaxSeq = nil
seenSeq = []
}
}
/// The highest event `seq` delivered for the open session — the warm-resubscribe cursor. On a
/// reconnect we re-subscribe `sinceSeq: openMaxSeq` so the host replays only what we missed
/// instead of cold-resetting to the 200-event tail (which would truncate a long transcript).
private var openMaxSeq: UInt64?
// MARK: Callbacks up to RemoteStore (aggregate concerns)