Merge pull request #6719 from matrix-org/travis/widgets/no-limits

Remove arbitrary limits from send/receive events for widgets
pull/21833/head
Travis Ralston 2021-09-01 11:26:15 -06:00 committed by GitHub
commit 3ed76f5de7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -163,7 +163,7 @@ export class StopGapWidgetDriver extends WidgetDriver {
} }
public async readRoomEvents(eventType: string, msgtype: string | undefined, limit: number): Promise<object[]> { 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 client = MatrixClientPeg.get();
const roomId = ActiveRoomObserver.activeRoomId; const roomId = ActiveRoomObserver.activeRoomId;
@ -185,7 +185,7 @@ export class StopGapWidgetDriver extends WidgetDriver {
} }
public async readStateEvents(eventType: string, stateKey: string | undefined, limit: number): Promise<object[]> { 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 client = MatrixClientPeg.get();
const roomId = ActiveRoomObserver.activeRoomId; const roomId = ActiveRoomObserver.activeRoomId;