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

Commit

Permalink
Remove arbitrary limits from send/receive events for widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Aug 31, 2021
1 parent a5ccd69 commit 18b7a64
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 18b7a64

Please sign in to comment.