Skip to content

Commit

Permalink
also check for M_NOT_FOUND
Browse files Browse the repository at this point in the history
  • Loading branch information
toger5 committed Dec 11, 2024
1 parent 1fcc3d2 commit 81cd4f8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/matrixrtc/MatrixRTCSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1188,12 +1188,17 @@ export class MatrixRTCSession extends TypedEventEmitter<MatrixRTCSessionEvent, M
knownDisconnectDelayId,
UpdateDelayedEventAction.Restart,
),
1000,
10,
);
} catch (e) {
logger.warn("Failed to update delayed disconnection event, prepare it again:", e);
this.disconnectDelayId = undefined;
await prepareDelayedDisconnection();
if (e instanceof MatrixError && e.errcode === "M_NOT_FOUND") {
// If we get a M_NOT_FOUND we prepare a new delayed event.
// In other error cases we do not want to prepare anything since we do not have the guarantee, that the
// future is not still running.
logger.warn("Failed to update delayed disconnection event, prepare it again:", e);
this.disconnectDelayId = undefined;
await prepareDelayedDisconnection();
}
}
}
if (this.disconnectDelayId !== undefined) {
Expand Down

0 comments on commit 81cd4f8

Please sign in to comment.