diff --git a/src/client.ts b/src/client.ts index b09402e..a4d14ce 100644 --- a/src/client.ts +++ b/src/client.ts @@ -155,17 +155,21 @@ export class Client { const { collections } = await this.api.getJSON<{ collections: RawCollection[]; }>("/collections/v2", { sinceTime: 0 }); - return collections.map((raw) => - decryptCollection( - raw, - { - masterKey: this.masterKey, - publicKey: this.publicKey, - secretKey: this.secretKey, - }, - this.userID, - ), - ); + // The sync API keeps returning deleted collections as tombstones + // (isDeleted: true); their diff endpoint 404s, so drop them. + return collections + .filter((raw) => !raw.isDeleted) + .map((raw) => + decryptCollection( + raw, + { + masterKey: this.masterKey, + publicKey: this.publicKey, + secretKey: this.secretKey, + }, + this.userID, + ), + ); } async listFiles(