also make filter request interruptable
This commit is contained in:
parent
cc19063c79
commit
52e2d3203e
1 changed files with 2 additions and 2 deletions
|
@ -80,8 +80,8 @@ export class Sync {
|
|||
async _syncRequest(syncToken, timeout) {
|
||||
let {syncFilterId} = this._session;
|
||||
if (typeof syncFilterId !== "string") {
|
||||
// TODO: this should be interruptable by stop, we can reuse _currentRequest
|
||||
syncFilterId = (await this._hsApi.createFilter(this._session.user.id, {room: {state: {lazy_load_members: true}}}).response()).filter_id;
|
||||
this._currentRequest = this._hsApi.createFilter(this._session.user.id, {room: {state: {lazy_load_members: true}}});
|
||||
syncFilterId = (await this._currentRequest.response()).filter_id;
|
||||
}
|
||||
const totalRequestTimeout = timeout + (80 * 1000); // same as riot-web, don't get stuck on wedged long requests
|
||||
this._currentRequest = this._hsApi.sync(syncToken, syncFilterId, timeout, {timeout: totalRequestTimeout});
|
||||
|
|
Reference in a new issue