From e92507081fe349f60e7e2d7a26eb791c927d81f1 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Wed, 17 May 2023 16:51:32 +0530 Subject: [PATCH] retain() in openTimeline --- src/domain/session/room/RoomViewModel.js | 1 - src/matrix/room/BaseRoom.js | 1 + src/matrix/verification/SAS/channel/RoomChannel.ts | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/domain/session/room/RoomViewModel.js b/src/domain/session/room/RoomViewModel.js index 413aae41..81835fb0 100644 --- a/src/domain/session/room/RoomViewModel.js +++ b/src/domain/session/room/RoomViewModel.js @@ -80,7 +80,6 @@ export class RoomViewModel extends ErrorReportViewModel { await this.logAndCatch("RoomViewModel.load", async log => { this._room.on("change", this._onRoomChange); const timeline = await this._room.openTimeline(log); - timeline.retain(); this.track(() => timeline.release()); this._tileOptions = this.childOptions({ session: this.getOption("session"), diff --git a/src/matrix/room/BaseRoom.js b/src/matrix/room/BaseRoom.js index fe0db293..5cfdc106 100644 --- a/src/matrix/room/BaseRoom.js +++ b/src/matrix/room/BaseRoom.js @@ -589,6 +589,7 @@ export class BaseRoom extends EventEmitter { } finally { resolve(); } + this._timeline.retain(); return this._timeline; }); } diff --git a/src/matrix/verification/SAS/channel/RoomChannel.ts b/src/matrix/verification/SAS/channel/RoomChannel.ts index d63dcf6a..801ec7a7 100644 --- a/src/matrix/verification/SAS/channel/RoomChannel.ts +++ b/src/matrix/verification/SAS/channel/RoomChannel.ts @@ -82,7 +82,6 @@ export class RoomChannel extends Disposables implements IChannel { private async subscribeToTimeline() { const timeline = await this.room.openTimeline(); - timeline.retain(); this.track(() => timeline.release()); this.track( timeline.entries.subscribe({