@@ -71,7 +71,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
7171
7272 private readonly watchedSettings = [
7373 'feature_custom_tags' ,
74- 'advancedRoomListLogging' , // TODO: Remove watch: https://github.com/vector-im/element-web/issues/14602
7574 ] ;
7675
7776 constructor ( ) {
@@ -122,8 +121,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
122121 this . readyStore . useUnitTestClient ( forcedClient ) ;
123122 }
124123
125- this . checkLoggingEnabled ( ) ;
126-
127124 for ( const settingName of this . watchedSettings ) SettingsStore . monitorSetting ( settingName , null ) ;
128125 RoomViewStore . addListener ( ( ) => this . handleRVSUpdate ( { } ) ) ;
129126 this . algorithm . on ( LIST_UPDATED_EVENT , this . onAlgorithmListUpdated ) ;
@@ -141,12 +138,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
141138 this . updateFn . trigger ( ) ;
142139 }
143140
144- private checkLoggingEnabled ( ) {
145- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
146- console . warn ( "Advanced room list logging is enabled" ) ;
147- }
148- }
149-
150141 private async readAndCacheSettingsFromStore ( ) {
151142 const tagsEnabled = SettingsStore . getValue ( "feature_custom_tags" ) ;
152143 await this . updateState ( {
@@ -172,10 +163,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
172163 console . warn ( `${ activeRoomId } is current in RVS but missing from client - clearing sticky room` ) ;
173164 this . algorithm . setStickyRoom ( null ) ;
174165 } else if ( activeRoom !== this . algorithm . stickyRoom ) {
175- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
176- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
177- console . log ( `Changing sticky room to ${ activeRoomId } ` ) ;
178- }
179166 this . algorithm . setStickyRoom ( activeRoom ) ;
180167 }
181168 }
@@ -218,14 +205,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
218205 if ( payload . action === Action . SettingUpdated ) {
219206 const settingUpdatedPayload = payload as SettingUpdatedPayload ;
220207 if ( this . watchedSettings . includes ( settingUpdatedPayload . settingName ) ) {
221- // TODO: Remove with https://github.com/vector-im/element-web/issues/14602
222- if ( settingUpdatedPayload . settingName === "advancedRoomListLogging" ) {
223- // Log when the setting changes so we know when it was turned on in the rageshake
224- const enabled = SettingsStore . getValue ( "advancedRoomListLogging" ) ;
225- console . warn ( "Advanced room list logging is enabled? " + enabled ) ;
226- return ;
227- }
228-
229208 console . log ( "Regenerating room lists: Settings changed" ) ;
230209 await this . readAndCacheSettingsFromStore ( ) ;
231210
@@ -248,20 +227,12 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
248227 console . warn ( `Own read receipt was in unknown room ${ room . roomId } ` ) ;
249228 return ;
250229 }
251- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
252- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
253- console . log ( `[RoomListDebug] Got own read receipt in ${ room . roomId } ` ) ;
254- }
255230 await this . handleRoomUpdate ( room , RoomUpdateCause . ReadReceipt ) ;
256231 this . updateFn . trigger ( ) ;
257232 return ;
258233 }
259234 } else if ( payload . action === 'MatrixActions.Room.tags' ) {
260235 const roomPayload = ( < any > payload ) ; // TODO: Type out the dispatcher types
261- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
262- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
263- console . log ( `[RoomListDebug] Got tag change in ${ roomPayload . room . roomId } ` ) ;
264- }
265236 await this . handleRoomUpdate ( roomPayload . room , RoomUpdateCause . PossibleTagChange ) ;
266237 this . updateFn . trigger ( ) ;
267238 } else if ( payload . action === 'MatrixActions.Room.timeline' ) {
@@ -273,16 +244,7 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
273244 const roomId = eventPayload . event . getRoomId ( ) ;
274245 const room = this . matrixClient . getRoom ( roomId ) ;
275246 const tryUpdate = async ( updatedRoom : Room ) => {
276- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
277- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
278- console . log ( `[RoomListDebug] Live timeline event ${ eventPayload . event . getId ( ) } ` +
279- ` in ${ updatedRoom . roomId } ` ) ;
280- }
281247 if ( eventPayload . event . getType ( ) === 'm.room.tombstone' && eventPayload . event . getStateKey ( ) === '' ) {
282- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
283- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
284- console . log ( `[RoomListDebug] Got tombstone event - trying to remove now-dead room` ) ;
285- }
286248 const newRoom = this . matrixClient . getRoom ( eventPayload . event . getContent ( ) [ 'replacement_room' ] ) ;
287249 if ( newRoom ) {
288250 // If we have the new room, then the new room check will have seen the predecessor
@@ -315,18 +277,10 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
315277 console . warn ( `Event ${ eventPayload . event . getId ( ) } was decrypted in an unknown room ${ roomId } ` ) ;
316278 return ;
317279 }
318- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
319- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
320- console . log ( `[RoomListDebug] Decrypted timeline event ${ eventPayload . event . getId ( ) } in ${ roomId } ` ) ;
321- }
322280 await this . handleRoomUpdate ( room , RoomUpdateCause . Timeline ) ;
323281 this . updateFn . trigger ( ) ;
324282 } else if ( payload . action === 'MatrixActions.accountData' && payload . event_type === 'm.direct' ) {
325283 const eventPayload = ( < any > payload ) ; // TODO: Type out the dispatcher types
326- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
327- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
328- console . log ( `[RoomListDebug] Received updated DM map` ) ;
329- }
330284 const dmMap = eventPayload . event . getContent ( ) ;
331285 for ( const userId of Object . keys ( dmMap ) ) {
332286 const roomIds = dmMap [ userId ] ;
@@ -350,65 +304,36 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
350304 const oldMembership = getEffectiveMembership ( membershipPayload . oldMembership ) ;
351305 const newMembership = getEffectiveMembership ( membershipPayload . membership ) ;
352306 if ( oldMembership !== EffectiveMembership . Join && newMembership === EffectiveMembership . Join ) {
353- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
354- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
355- console . log ( `[RoomListDebug] Handling new room ${ membershipPayload . room . roomId } ` ) ;
356- }
357-
358307 // If we're joining an upgraded room, we'll want to make sure we don't proliferate
359308 // the dead room in the list.
360309 const createEvent = membershipPayload . room . currentState . getStateEvents ( "m.room.create" , "" ) ;
361310 if ( createEvent && createEvent . getContent ( ) [ 'predecessor' ] ) {
362- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
363- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
364- console . log ( `[RoomListDebug] Room has a predecessor` ) ;
365- }
366311 const prevRoom = this . matrixClient . getRoom ( createEvent . getContent ( ) [ 'predecessor' ] [ 'room_id' ] ) ;
367312 if ( prevRoom ) {
368313 const isSticky = this . algorithm . stickyRoom === prevRoom ;
369314 if ( isSticky ) {
370- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
371- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
372- console . log ( `[RoomListDebug] Clearing sticky room due to room upgrade` ) ;
373- }
374315 this . algorithm . setStickyRoom ( null ) ;
375316 }
376317
377318 // Note: we hit the algorithm instead of our handleRoomUpdate() function to
378319 // avoid redundant updates.
379- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
380- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
381- console . log ( `[RoomListDebug] Removing previous room from room list` ) ;
382- }
383320 this . algorithm . handleRoomUpdate ( prevRoom , RoomUpdateCause . RoomRemoved ) ;
384321 }
385322 }
386323
387- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
388- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
389- console . log ( `[RoomListDebug] Adding new room to room list` ) ;
390- }
391324 await this . handleRoomUpdate ( membershipPayload . room , RoomUpdateCause . NewRoom ) ;
392325 this . updateFn . trigger ( ) ;
393326 return ;
394327 }
395328
396329 if ( oldMembership !== EffectiveMembership . Invite && newMembership === EffectiveMembership . Invite ) {
397- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
398- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
399- console . log ( `[RoomListDebug] Handling invite to ${ membershipPayload . room . roomId } ` ) ;
400- }
401330 await this . handleRoomUpdate ( membershipPayload . room , RoomUpdateCause . NewRoom ) ;
402331 this . updateFn . trigger ( ) ;
403332 return ;
404333 }
405334
406335 // If it's not a join, it's transitioning into a different list (possibly historical)
407336 if ( oldMembership !== newMembership ) {
408- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
409- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
410- console . log ( `[RoomListDebug] Handling membership change in ${ membershipPayload . room . roomId } ` ) ;
411- }
412337 await this . handleRoomUpdate ( membershipPayload . room , RoomUpdateCause . PossibleTagChange ) ;
413338 this . updateFn . trigger ( ) ;
414339 return ;
@@ -438,10 +363,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
438363
439364 const shouldUpdate = this . algorithm . handleRoomUpdate ( room , cause ) ;
440365 if ( shouldUpdate ) {
441- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
442- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
443- console . log ( `[DEBUG] Room "${ room . name } " (${ room . roomId } ) triggered by ${ cause } requires list update` ) ;
444- }
445366 this . updateFn . mark ( ) ;
446367 }
447368 }
@@ -450,11 +371,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
450371 if ( ! this . algorithm ) return ;
451372 if ( ! this . algorithm . hasTagSortingMap ) return ; // we're still loading
452373
453- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
454- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
455- console . log ( "Calculating new prefiltered room list" ) ;
456- }
457-
458374 // Inhibit updates because we're about to lie heavily to the algorithm
459375 this . algorithm . updatesInhibited = true ;
460376
@@ -588,10 +504,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
588504 }
589505
590506 private onAlgorithmListUpdated = ( ) => {
591- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
592- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
593- console . log ( "Underlying algorithm has triggered a list update - marking" ) ;
594- }
595507 this . updateFn . mark ( ) ;
596508 } ;
597509
@@ -673,10 +585,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
673585 * @param {IFilterCondition } filter The filter condition to add.
674586 */
675587 public async addFilter ( filter : IFilterCondition ) : Promise < void > {
676- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
677- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
678- console . log ( "Adding filter condition:" , filter ) ;
679- }
680588 let promise = Promise . resolve ( ) ;
681589 if ( filter . kind === FilterKind . Prefilter ) {
682590 filter . on ( FILTER_CHANGED , this . onPrefilterUpdated ) ;
@@ -705,10 +613,6 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
705613 * @param {IFilterCondition } filter The filter condition to remove.
706614 */
707615 public removeFilter ( filter : IFilterCondition ) : void {
708- if ( SettingsStore . getValue ( "advancedRoomListLogging" ) ) {
709- // TODO: Remove debug: https://github.com/vector-im/element-web/issues/14602
710- console . log ( "Removing filter condition:" , filter ) ;
711- }
712616 let promise = Promise . resolve ( ) ;
713617 let idx = this . filterConditions . indexOf ( filter ) ;
714618 let removed = false ;
0 commit comments