Skip to content

Commit

Permalink
fix awaiting for room state with and without new UpdateState method.
Browse files Browse the repository at this point in the history
  • Loading branch information
toger5 committed Jan 24, 2025
1 parent e2b0e02 commit eaca582
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/embedded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,11 @@ export class RoomWidgetClient extends MatrixClient {

await this.widgetApiReady;

if (!(await this.supportUpdateState())) {
// sync room state:
if (await this.supportUpdateState()) {
// This will resolve once the client driver has sent us all the allowed room state.
await this.roomStateSynced;
} else {
// Backfill the requested events
// We only get the most recent event for every type + state key combo,
// so it doesn't really matter what order we inject them in
Expand Down Expand Up @@ -320,8 +324,6 @@ export class RoomWidgetClient extends MatrixClient {
}, 1000 * opts.clientWellKnownPollPeriod);
this.fetchClientWellKnown();
}

await this.roomStateSynced;
this.setSyncState(SyncState.Syncing);
logger.info("Finished initial sync");

Expand Down

0 comments on commit eaca582

Please sign in to comment.