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

Commit 3e2ae2b

Browse files
authored
Merge pull request #4915 from matrix-org/travis/fix-setting-spam
Mute "Unknown room caused setting update" spam
2 parents f4d2286 + 7963ed6 commit 3e2ae2b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/settings/handlers/RoomSettingsHandler.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,14 @@ export default class RoomSettingsHandler extends MatrixClientBackedSettingsHandl
4343
const roomId = event.getRoomId();
4444
const room = this.client.getRoom(roomId);
4545

46-
// Note: the tests often fire setting updates that don't have rooms in the store, so
47-
// we fail softly here. We shouldn't assume that the state being fired is current
48-
// state, but we also don't need to explode just because we didn't find a room.
49-
if (!room) console.warn(`Unknown room caused setting update: ${roomId}`);
50-
if (room && state !== room.currentState) return; // ignore state updates which are not current
46+
// Note: in tests and during the encryption setup on initial load we might not have
47+
// rooms in the store, so we just quietly ignore the problem. If we log it then we'll
48+
// just end up spamming the logs a few thousand times. It is perfectly fine for us
49+
// to ignore the problem as the app will not have loaded enough to care yet.
50+
if (!room) return;
51+
52+
// ignore state updates which are not current
53+
if (room && state !== room.currentState) return;
5154

5255
if (event.getType() === "org.matrix.room.preview_urls") {
5356
let val = event.getContent()['disable'];

0 commit comments

Comments
 (0)