You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
EventIndex: Don't process checkpoints that don't have a valid token.
Some rooms might have null as a token, don't add those to be crawled nor to the index. Catch any other errors that might occur during the addition of an initial checkpoint and log them.
This commit is contained in:
@@ -115,10 +115,20 @@ export default class EventIndex extends EventEmitter {
|
|||||||
direction: "f",
|
direction: "f",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (backCheckpoint.token) {
|
||||||
await indexManager.addCrawlerCheckpoint(backCheckpoint);
|
await indexManager.addCrawlerCheckpoint(backCheckpoint);
|
||||||
await indexManager.addCrawlerCheckpoint(forwardCheckpoint);
|
|
||||||
this.crawlerCheckpoints.push(backCheckpoint);
|
this.crawlerCheckpoints.push(backCheckpoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (forwardCheckpoint.token) {
|
||||||
|
await indexManager.addCrawlerCheckpoint(forwardCheckpoint);
|
||||||
this.crawlerCheckpoints.push(forwardCheckpoint);
|
this.crawlerCheckpoints.push(forwardCheckpoint);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log("EventIndex: Error adding initial checkpoints for room",
|
||||||
|
room.roomId, backCheckpoint, forwardCheckpoint, e);
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user