Fetch Historical Transcript Data

Nucleic-Session: 11465D90-A8F3-43AA-A1DC-37EA1EC1B909
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-05 19:27:08 -07:00
co-authored by Nucleic
parent b9bca32d20
commit a3bb7e5d61
@@ -42,6 +42,8 @@ final class HostConnection {
guard openSessionID != oldValue else { return } guard openSessionID != oldValue else { return }
openMaxSeq = nil openMaxSeq = nil
seenSeq = [] seenSeq = []
transcriptFetchRequestID = nil
didStartFullFetch = false
} }
} }
@@ -50,6 +52,15 @@ final class HostConnection {
/// instead of cold-resetting to the 200-event tail (which would truncate a long transcript). /// instead of cold-resetting to the 200-event tail (which would truncate a long transcript).
private var openMaxSeq: UInt64? private var openMaxSeq: UInt64?
/// The in-flight full-history fetch's request id (mesh full-transcript sync). On open we pull the
/// *whole* transcript — the cold `subscribe` only returns a 200-event tail — and merge its chunks
/// into the transcript on screen; replies are matched on this id so a late batch from a previous
/// open (the session changed underneath us) is dropped. `didStartFullFetch` guards against issuing
/// it twice — both `open` and the reconnect nudge call `fetchFullTranscript`, but only the first
/// that finds a live, capable connection actually sends.
private var transcriptFetchRequestID: String?
private var didStartFullFetch = false
// MARK: Callbacks up to RemoteStore (aggregate concerns) // MARK: Callbacks up to RemoteStore (aggregate concerns)
/// How a `HostConnection` talks back to `RemoteStore`. All fire on the main actor. /// How a `HostConnection` talks back to `RemoteStore`. All fire on the main actor.