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

Commit 95bc4a6

Browse files
authored
Merge pull request #4886 from matrix-org/travis/room-list/logs-1
Remove a bunch of noisy logging from the room list
2 parents 08392d5 + 98ce1da commit 95bc4a6

File tree

6 files changed

+0
-43
lines changed

6 files changed

+0
-43
lines changed

src/stores/room-list/RoomListStore2.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ export class RoomListStore2 extends AsyncStore<ActionPayload> {
101101
console.warn(`${activeRoomId} is current in RVS but missing from client - clearing sticky room`);
102102
this.algorithm.stickyRoom = null;
103103
} else if (activeRoom !== this.algorithm.stickyRoom) {
104-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
105-
console.log(`Changing sticky room to ${activeRoomId}`);
106104
this.algorithm.stickyRoom = activeRoom;
107105
}
108106
}
@@ -299,8 +297,6 @@ export class RoomListStore2 extends AsyncStore<ActionPayload> {
299297
private async handleRoomUpdate(room: Room, cause: RoomUpdateCause): Promise<any> {
300298
const shouldUpdate = await this.algorithm.handleRoomUpdate(room, cause);
301299
if (shouldUpdate) {
302-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
303-
console.log(`[DEBUG] Room "${room.name}" (${room.roomId}) triggered by ${cause} requires list update`);
304300
this.emit(LISTS_UPDATE_EVENT, this);
305301
}
306302
}
@@ -367,8 +363,6 @@ export class RoomListStore2 extends AsyncStore<ActionPayload> {
367363
}
368364

369365
private onAlgorithmListUpdated = () => {
370-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
371-
console.log("Underlying algorithm has triggered a list update - refiring");
372366
this.emit(LISTS_UPDATE_EVENT, this);
373367
};
374368

@@ -408,17 +402,13 @@ export class RoomListStore2 extends AsyncStore<ActionPayload> {
408402
}
409403

410404
public addFilter(filter: IFilterCondition): void {
411-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
412-
console.log("Adding filter condition:", filter);
413405
this.filterConditions.push(filter);
414406
if (this.algorithm) {
415407
this.algorithm.addFilterCondition(filter);
416408
}
417409
}
418410

419411
public removeFilter(filter: IFilterCondition): void {
420-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
421-
console.log("Removing filter condition:", filter);
422412
const idx = this.filterConditions.indexOf(filter);
423413
if (idx >= 0) {
424414
this.filterConditions.splice(idx, 1);

src/stores/room-list/algorithms/Algorithm.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,6 @@ export class Algorithm extends EventEmitter {
272272
}
273273
}
274274
newMap[tagId] = allowedRoomsInThisTag;
275-
276-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
277-
console.log(`[DEBUG] ${newMap[tagId].length}/${rooms.length} rooms filtered into ${tagId}`);
278275
}
279276

280277
const allowedRooms = Object.values(newMap).reduce((rv, v) => { rv.push(...v); return rv; }, <Room[]>[]);
@@ -310,9 +307,6 @@ export class Algorithm extends EventEmitter {
310307
if (filteredRooms.length > 0) {
311308
this.filteredRooms[tagId] = filteredRooms;
312309
}
313-
314-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
315-
console.log(`[DEBUG] ${filteredRooms.length}/${rooms.length} rooms filtered into ${tagId}`);
316310
}
317311

318312
protected tryInsertStickyRoomToFilterSet(rooms: Room[], tagId: TagID) {
@@ -351,8 +345,6 @@ export class Algorithm extends EventEmitter {
351345
}
352346

353347
if (!this._cachedStickyRooms || !updatedTag) {
354-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
355-
console.log(`Generating clone of cached rooms for sticky room handling`);
356348
const stickiedTagMap: ITagMap = {};
357349
for (const tagId of Object.keys(this.cachedRooms)) {
358350
stickiedTagMap[tagId] = this.cachedRooms[tagId].map(r => r); // shallow clone
@@ -363,8 +355,6 @@ export class Algorithm extends EventEmitter {
363355
if (updatedTag) {
364356
// Update the tag indicated by the caller, if possible. This is mostly to ensure
365357
// our cache is up to date.
366-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
367-
console.log(`Replacing cached sticky rooms for ${updatedTag}`);
368358
this._cachedStickyRooms[updatedTag] = this.cachedRooms[updatedTag].map(r => r); // shallow clone
369359
}
370360

@@ -373,8 +363,6 @@ export class Algorithm extends EventEmitter {
373363
// we might have updated from the cache is also our sticky room.
374364
const sticky = this._stickyRoom;
375365
if (!updatedTag || updatedTag === sticky.tag) {
376-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
377-
console.log(`Inserting sticky room ${sticky.room.roomId} at position ${sticky.position} in ${sticky.tag}`);
378366
this._cachedStickyRooms[sticky.tag].splice(sticky.position, 0, sticky.room);
379367
}
380368

@@ -466,13 +454,9 @@ export class Algorithm extends EventEmitter {
466454
// Split out the easy rooms first (leave and invite)
467455
const memberships = splitRoomsByMembership(rooms);
468456
for (const room of memberships[EffectiveMembership.Invite]) {
469-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
470-
console.log(`[DEBUG] "${room.name}" (${room.roomId}) is an Invite`);
471457
newTags[DefaultTagID.Invite].push(room);
472458
}
473459
for (const room of memberships[EffectiveMembership.Leave]) {
474-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
475-
console.log(`[DEBUG] "${room.name}" (${room.roomId}) is Historical`);
476460
newTags[DefaultTagID.Archived].push(room);
477461
}
478462

@@ -483,11 +467,7 @@ export class Algorithm extends EventEmitter {
483467
let inTag = false;
484468
if (tags.length > 0) {
485469
for (const tag of tags) {
486-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
487-
console.log(`[DEBUG] "${room.name}" (${room.roomId}) is tagged as ${tag}`);
488470
if (!isNullOrUndefined(newTags[tag])) {
489-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
490-
console.log(`[DEBUG] "${room.name}" (${room.roomId}) is tagged with VALID tag ${tag}`);
491471
newTags[tag].push(room);
492472
inTag = true;
493473
}
@@ -497,9 +477,6 @@ export class Algorithm extends EventEmitter {
497477
if (!inTag) {
498478
// TODO: Determine if DM and push there instead: https://github.com/vector-im/riot-web/issues/14236
499479
newTags[DefaultTagID.Untagged].push(room);
500-
501-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
502-
console.log(`[DEBUG] "${room.name}" (${room.roomId}) is Untagged`);
503480
}
504481
}
505482

src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ export class ImportanceAlgorithm extends OrderingAlgorithm {
8787

8888
public constructor(tagId: TagID, initialSortingAlgorithm: SortAlgorithm) {
8989
super(tagId, initialSortingAlgorithm);
90-
91-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
92-
console.log(`[RoomListDebug] Constructed an ImportanceAlgorithm for ${tagId}`);
9390
}
9491

9592
// noinspection JSMethodCanBeStatic

src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ export class NaturalAlgorithm extends OrderingAlgorithm {
2828

2929
public constructor(tagId: TagID, initialSortingAlgorithm: SortAlgorithm) {
3030
super(tagId, initialSortingAlgorithm);
31-
32-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
33-
console.log(`[RoomListDebug] Constructed a NaturalAlgorithm for ${tagId}`);
3431
}
3532

3633
public async setRooms(rooms: Room[]): Promise<any> {

src/stores/room-list/filters/CommunityFilterCondition.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ export class CommunityFilterCondition extends EventEmitter implements IFilterCon
5252
const beforeRoomIds = this.roomIds;
5353
this.roomIds = (await GroupStore.getGroupRooms(this.community.groupId)).map(r => r.roomId);
5454
if (arrayHasDiff(beforeRoomIds, this.roomIds)) {
55-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
56-
console.log("Updating filter for group: ", this.community.groupId);
5755
this.emit(FILTER_CHANGED);
5856
}
5957
};

src/stores/room-list/filters/NameFilterCondition.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ export class NameFilterCondition extends EventEmitter implements IFilterConditio
4141

4242
public set search(val: string) {
4343
this._search = val;
44-
// TODO: Remove debug: https://github.com/vector-im/riot-web/issues/14035
45-
console.log("Updating filter for room name search:", this._search);
4644
this.emit(FILTER_CHANGED);
4745
}
4846

0 commit comments

Comments
 (0)