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

Commit

Permalink
Merge pull request #6719 from matrix-org/travis/widgets/no-limits
Browse files Browse the repository at this point in the history
Remove arbitrary limits from send/receive events for widgets
  • Loading branch information
turt2live committed Sep 1, 2021
2 parents 0d2f7db + 18b7a64 commit 3ed76f5
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 3ed76f5

Please sign in to comment.