2676
return;
2677
}
2678
>
const entries: IPersistedPeerChat[] = legacy.map(chat => ({
agentService.ts
2679
>
uri: chat.uri.toString(),
2680
>
...(chat.providerData !== undefined ? { providerData: chat.providerData } : {}),
2681
>
}));
2682
>
await this._restorePeerChatsFromCatalog(agent, session, entries);
2683
>
// Single atomic write: the key is absent before and complete after, so no
2684
>
// partial catalog can survive a crash mid-migration (which would make
2685
>
// `_readPersistedPeerChatCatalog` return a proper subset and permanently
2686
>
// skip re-migration). The callback takes no parameter so `entries` here is
2687
>
// the full migrated set, not the (absent) current catalog.
2688
>
await this._enqueuePeerChatCatalogWrite(session, () => [...entries]);
2689
}
2690