Skip to content

Commit

Permalink
ignore non-existent message
Browse files Browse the repository at this point in the history
  • Loading branch information
mistermoe committed Jun 8, 2023
1 parent dd83cec commit 49f8e7b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/web5-user-agent/src/sync-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,16 @@ export class SyncApi implements SyncManager {
}

for (let entry of reply.messages) {
// TODO: check entry.error
if (entry.error || !entry.message) {
console.warn(`message ${messageCid} not found. entry: ${JSON.stringify(entry, null, 2)} ignoring..`);

await this.setWatermark(did, dwnUrl, 'pull', watermark);
await this.#addMessage(did, messageCid);
delOps.push({ type: 'del', key });

continue;
}

const messageType = this.#getDwnMessageType(entry.message);
let dataStream;

Expand Down

0 comments on commit 49f8e7b

Please sign in to comment.