Session Sync Repair
Nucleic-Session: 0C7BC346-0002-4533-ADDD-3B4C92E58527 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -35,7 +35,20 @@ final class HostConnection {
|
|||||||
|
|
||||||
/// The session RemoteStore currently has open on this host, if any — so snapshot/events are only
|
/// 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.
|
/// 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)
|
// MARK: Callbacks up to RemoteStore (aggregate concerns)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user