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

Remove arbitrary limits from send/receive events for widgets #6719

Merged
merged 1 commit into from
Sep 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/stores/widgets/StopGapWidgetDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class StopGapWidgetDriver extends WidgetDriver {
}

public async readRoomEvents(eventType: string, msgtype: string | undefined, limit: number): Promise<object[]> {
limit = limit > 0 ? Math.min(limit, 25) : 25; // arbitrary choice
limit = limit > 0 ? Math.min(limit, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER; // relatively arbitrary

const client = MatrixClientPeg.get();
const roomId = ActiveRoomObserver.activeRoomId;
Expand All @@ -185,7 +185,7 @@ export class StopGapWidgetDriver extends WidgetDriver {
}

public async readStateEvents(eventType: string, stateKey: string | undefined, limit: number): Promise<object[]> {
limit = limit > 0 ? Math.min(limit, 100) : 100; // arbitrary choice
limit = limit > 0 ? Math.min(limit, Number.MAX_SAFE_INTEGER) : Number.MAX_SAFE_INTEGER; // relatively arbitrary

const client = MatrixClientPeg.get();
const roomId = ActiveRoomObserver.activeRoomId;
Expand Down