Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Sync v2 performance, initial sync limit=1 #9299

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/@types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import ActiveWidgetStore from "../stores/ActiveWidgetStore";
import AutoRageshakeStore from "../stores/AutoRageshakeStore";
import { IConfigOptions } from "../IConfigOptions";
import { MatrixDispatcher } from "../dispatcher/dispatcher";
import { MessagePreviewStore } from "../stores/room-list/MessagePreviewStore";

/* eslint-disable @typescript-eslint/naming-convention */

Expand Down Expand Up @@ -109,6 +110,7 @@ declare global {
mxLoginWithAccessToken: (hsUrl: string, accessToken: string) => Promise<void>;
mxAutoRageshakeStore?: AutoRageshakeStore;
mxDispatcher: MatrixDispatcher;
mxMessagePreviewStore: MessagePreviewStore;
}

interface Electron {
Expand Down
4 changes: 3 additions & 1 deletion src/MatrixClientPeg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ class MatrixClientPegClass implements IMatrixClientPeg {
// at any time up to after the 'will_start_client'
// event is finished processing.
public opts: IStartClientOpts = {
initialSyncLimit: 20,
// We ask for only a single timeline event per-room in the initial sync to make it faster.
// We'll eagerly backfill rooms after this initial sync.
initialSyncLimit: 1,
};

private matrixClient: MatrixClient = null;
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/settings/EventIndexPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default class EventIndexPanel extends React.Component<{}, IState> {

await EventIndexPeg.initEventIndex();
await EventIndexPeg.get().addInitialCheckpoints();
EventIndexPeg.get().startCrawler();
EventIndexPeg.start();
await SettingsStore.setValue('enableEventIndexing', null, SettingLevel.DEVICE, true);
await this.updateState();
};
Expand Down
Loading