Fetch Historical Transcript Data
Nucleic-Session: 11465D90-A8F3-43AA-A1DC-37EA1EC1B909 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -630,6 +630,21 @@ final class HostConnection {
|
||||
Task { await client.send(msg) }
|
||||
}
|
||||
|
||||
/// Pull the open session's *full* transcript via mesh full-transcript sync and merge it into the
|
||||
/// transcript on screen. The cold `subscribe` only returns the host's 200-event tail, so without
|
||||
/// this the phone shows nothing from before it connected. `afterSeq: 0` asks for the whole history
|
||||
/// (overlap with the tail is deduped on arrival). Idempotent per open — guarded by
|
||||
/// `didStartFullFetch` — and a no-op when the host predates `canSyncTranscripts` (the tail still
|
||||
/// shows) or the connection isn't live yet (the reconnect handler retries once it is).
|
||||
func fetchFullTranscript(_ sessionID: SessionID) {
|
||||
guard sessionID == openSessionID, !didStartFullFetch,
|
||||
capabilities.canSyncTranscripts, client != nil else { return }
|
||||
didStartFullFetch = true
|
||||
let requestID = UUID().uuidString
|
||||
transcriptFetchRequestID = requestID
|
||||
send(.fetchTranscript(TranscriptFetch(requestID: requestID, sessionID: sessionID, afterSeq: 0)))
|
||||
}
|
||||
|
||||
/// The device's network path changed (Wi-Fi ⇄ cellular, joined/left a network). React now rather
|
||||
/// than waiting for a zombie LAN socket to time out or the reconnect backoff to elapse — this is
|
||||
/// what makes the transport switch feel immediate. Only reconnect-managed hosts (a pinned host)
|
||||
|
||||
Reference in New Issue
Block a user