const legacy = await agent.listLegacyChats?.(session);
if (!legacy || legacy.length === 0) {
// returns `[]` on subsequent restores and this migration never re-runs.
await this._enqueuePeerChatCatalogWrite(session, () => []);
return;
}
const entries: IPersistedPeerChat[] = legacy.map(chat => ({
uri: chat.uri.toString(),