Only show error toast when importing unknown frames

This commit is contained in:
trevor-signal 2025-02-10 17:09:12 -05:00 committed by GitHub
parent 5bdb39a95b
commit cf5dc4b940
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -503,9 +503,19 @@ export class BackupImportStream extends Writable {
await this.#fromStickerPack(frame.stickerPack);
} else if (frame.adHocCall) {
await this.#fromAdHocCall(frame.adHocCall);
} else if (frame.notificationProfile) {
log.warn(
`${this.#logId}: Received currently unsupported feature: notification profile. Dropping.`
);
} else if (frame.chatFolder) {
log.warn(
`${this.#logId}: Received currently unsupported feature: chat folder. Dropping.`
);
} else {
log.warn(`${this.#logId}: unsupported frame item ${frame.item}`);
throw new Error('Unsupported frame type');
log.warn(
`${this.#logId}: unknown unsupported frame item ${frame.item}`
);
throw new Error('Unknown unsupported frame type');
}
} catch (error) {
this.#frameErrorCount += 1;