Skip to content

Commit

Permalink
Merge pull request #1373 from matrix-org/hs/fix-membership-sync-never…
Browse files Browse the repository at this point in the history
…-completing

Do not attempt to sync membership from a room we can't access
  • Loading branch information
Half-Shot committed Jun 8, 2021
2 parents 98cc5bc + c79dcc8 commit 6488006
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/1373.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the bridge never syncing membership if it cannot get the joined users for a room on startup.
4 changes: 4 additions & 0 deletions src/bridge/MemberListSyncer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ export class MemberListSyncer {
}
catch (err) {
log.error(`Failed to getJoinedMembers in room ${roomId}: ${err}`);
if (err.data?.errcode === "M_FORBIDDEN") {
// If we're not allowed to, just give up.
return;
}
await Bluebird.delay(3000); // wait a bit before retrying
}
}
Expand Down

0 comments on commit 6488006

Please sign in to comment.