196
197
parsePersistedStaticChangesets(sessionUri: ProtocolURI, metadata: IPersistedChangesetMetadata): IRestoredChangesetDiffs {
198
>
const persistedBranch = tryParsePersistedDiffs(metadata.branchRaw, sessionUri, 'branch', this._logService);
agentHostChangesetService.ts
199
>
200
>
// Legacy `diffs` is the migration fallback for the session-wide
201
>
// changeset only — it never carried uncommitted state.
202
>
const persistedSession = tryParsePersistedDiffs(metadata.sessionRaw, sessionUri, 'session', this._logService)
203
>
?? tryParsePersistedDiffs(metadata.legacyRaw, sessionUri, 'session (legacy)', this._logService);
204
>
205
>
return { branch: persistedBranch, session: persistedSession };
206
>
}
207
208
applyPersistedStaticChangesets(sessionUri: ProtocolURI, diffs: IRestoredChangesetDiffs): void {
210
>
// changeset state is absent or empty. Live state (e.g. from a prior
211
>
// refresh in this lifetime) is always more authoritative than a
212
>
// potentially-stale persisted blob; without this guard a fresh
213
>
// `restorePersistedStaticChangesets` call would clobber it.
214
>
this._seedIfEmpty(sessionUri, 'branch', diffs.branch);
215
>
this._seedIfEmpty(sessionUri, 'session', diffs.session);
216
>
}
217
218
restorePersistedStaticChangesets(sessionUri: ProtocolURI, metadata: IPersistedChangesetMetadata): IRestoredChangesetDiffs {
220
>
this.applyPersistedStaticChangesets(sessionUri, parsed);
221
>
return parsed;
222
>
}
223
224
persistChangesSummary(sessionUri: ProtocolURI, summary: ChangesSummary): void {