You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-13 08:02:38 +03:00
EventIndex: Move the checkpoint loading logic into the init method.
The checkpoints don't seem to be loaded anymore in the onSync method, the reason why this has stopped working is left unexplored since loading the checkpoints makes most sense during the initialization step anyways.
This commit is contained in:
@@ -35,7 +35,12 @@ export default class EventIndex {
|
||||
|
||||
async init() {
|
||||
const indexManager = PlatformPeg.get().getEventIndexingManager();
|
||||
|
||||
await indexManager.initEventIndex();
|
||||
console.log("EventIndex: Successfully initialized the event index");
|
||||
|
||||
this.crawlerCheckpoints = await indexManager.loadCheckpoints();
|
||||
console.log("EventIndex: Loaded checkpoints", this.crawlerCheckpoints);
|
||||
|
||||
this.registerListeners();
|
||||
}
|
||||
@@ -62,14 +67,6 @@ export default class EventIndex {
|
||||
onSync = async (state, prevState, data) => {
|
||||
const indexManager = PlatformPeg.get().getEventIndexingManager();
|
||||
|
||||
if (prevState === null && state === "PREPARED") {
|
||||
// Load our stored checkpoints, if any.
|
||||
this.crawlerCheckpoints = await indexManager.loadCheckpoints();
|
||||
console.log("EventIndex: Loaded checkpoints",
|
||||
this.crawlerCheckpoints);
|
||||
return;
|
||||
}
|
||||
|
||||
if (prevState === "PREPARED" && state === "SYNCING") {
|
||||
const addInitialCheckpoints = async () => {
|
||||
const client = MatrixClientPeg.get();
|
||||
|
||||
@@ -55,8 +55,6 @@ class EventIndexPeg {
|
||||
return false;
|
||||
}
|
||||
|
||||
console.log("EventIndex: Successfully initialized the event index");
|
||||
|
||||
this.index = index;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user