@@ -6389,7 +6389,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
63896389 next_batch : searchResults . next_batch ,
63906390 } ;
63916391
6392- const promise = this . search ( searchOpts )
6392+ const promise = this . search ( searchOpts , searchResults . abortSignal )
63936393 . then ( res => this . processRoomEventsSearch ( searchResults , res ) )
63946394 . finally ( ( ) => {
63956395 searchResults . pendingRequest = undefined ;
@@ -8439,17 +8439,19 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
84398439 * @param {Object } opts
84408440 * @param {string } opts.next_batch the batch token to pass in the query string
84418441 * @param {Object } opts.body the JSON object to pass to the request body.
8442+ * @param {AbortSignal= } abortSignal optional signal used to cancel the http request.
84428443 * @return {Promise } Resolves: TODO
84438444 * @return {module:http-api.MatrixError } Rejects: with an error response.
84448445 */
84458446 public search (
84468447 opts : { body : ISearchRequestBody , next_batch ?: string } , // eslint-disable-line camelcase
8448+ abortSignal ?: AbortSignal ,
84478449 ) : Promise < ISearchResponse > {
84488450 const queryParams : any = { } ;
84498451 if ( opts . next_batch ) {
84508452 queryParams . next_batch = opts . next_batch ;
84518453 }
8452- return this . http . authedRequest ( Method . Post , "/search" , queryParams , opts . body ) ;
8454+ return this . http . authedRequest ( Method . Post , "/search" , queryParams , opts . body , { abortSignal } ) ;
84538455 }
84548456
84558457 /**
0 commit comments