Skip to content

Commit fa5f2d3

Browse files
authored
Fix incorrect assumptions about required fields in /search response (#4228)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent 9fc557f commit fa5f2d3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/@types/search.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ enum GroupKey {
5454
}
5555

5656
export interface IResultRoomEvents {
57-
count: number;
58-
highlights: string[];
59-
results: ISearchResult[];
57+
count?: number;
58+
highlights?: string[];
59+
results?: ISearchResult[];
6060
state?: { [roomId: string]: IStateEventWithRoomId[] };
6161
groups?: {
6262
[groupKey in GroupKey]: {

src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7109,7 +7109,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
71097109
// append the new results to our existing results
71107110
const resultsLength = roomEvents.results?.length ?? 0;
71117111
for (let i = 0; i < resultsLength; i++) {
7112-
const sr = SearchResult.fromJson(roomEvents.results[i], mapper);
7112+
const sr = SearchResult.fromJson(roomEvents.results![i], mapper);
71137113
const room = this.getRoom(sr.context.getEvent().getRoomId());
71147114
if (room) {
71157115
// Copy over a known event sender if we can

0 commit comments

Comments
 (0)