diff options
Diffstat (limited to 'packages/backend/src/server/api/stream/Connection.ts')
| -rw-r--r-- | packages/backend/src/server/api/stream/Connection.ts | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/packages/backend/src/server/api/stream/Connection.ts b/packages/backend/src/server/api/stream/Connection.ts index ed0c789c1f..1ed2e5e9a5 100644 --- a/packages/backend/src/server/api/stream/Connection.ts +++ b/packages/backend/src/server/api/stream/Connection.ts @@ -36,8 +36,6 @@ export default class Connection { public subscriber: StreamEventEmitter; private channels = new Map<string, Channel>(); private subscribingNotes = new Map<string, number>(); - // TODO see if we should remove this, now that it has no more reads - private cachedNotes = new Map<string, Packed<'Note'>>(); public userProfile: MiUserProfile | null = null; public following: Record<string, Pick<MiFollowing, 'withReplies'> | undefined> = {}; public followingChannels: Set<string> = new Set(); @@ -156,24 +154,6 @@ export default class Connection { } @bindThis - public cacheNote(note: Packed<'Note'>) { - const add = (note: Packed<'Note'>) => { - this.cachedNotes.set(note.id, note); - - while (this.cachedNotes.size > MAX_CACHED_NOTES_PER_CONNECTION) { - // Map maintains insertion order, so first key is always the oldest - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const oldestKey = this.cachedNotes.keys().next().value!; - this.cachedNotes.delete(oldestKey); - } - }; - - add(note); - if (note.reply) add(note.reply); - if (note.renote) add(note.renote); - } - - @bindThis private onReadNotification(payload: JsonValue | undefined) { this.notificationService.readAllNotification(this.user!.id); } @@ -371,6 +351,5 @@ export default class Connection { this.fetchIntervalId = null; this.channels.clear(); this.subscribingNotes.clear(); - this.cachedNotes.clear(); } } |