From bfb32ad6277351076a27a2b6303ab5b7314d4d6c Mon Sep 17 00:00:00 2001 From: TSO Date: Fri, 11 Apr 2025 08:16:07 +0200 Subject: [PATCH] [IMP] add `sequence` to the valid `SessionInfo` keys Sequence is a new property of RTCSessions[1] which is used to determine the order of connections to avoid race conditions in "multi-network" (SFU/P2P hybrid) cases. [1]: https://github.com/odoo/odoo/pull/205198 --- src/models/session.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/models/session.js b/src/models/session.js index 4e5b75a..99543c3 100644 --- a/src/models/session.js +++ b/src/models/session.js @@ -17,6 +17,7 @@ import { * @property {boolean} isSelfMuted * @property {boolean} isDeaf * @property {boolean} isRaisingHand + * @property {number} sequence */ /** @@ -80,6 +81,7 @@ export class Session extends EventEmitter { isDeaf: undefined, isCameraOn: undefined, isScreenSharingOn: undefined, + sequence: undefined, }); /** @type {string} */ remote; @@ -564,7 +566,9 @@ export class Session extends EventEmitter { case CLIENT_MESSAGE.INFO_CHANGE: { for (const [key, value] of Object.entries(payload.info)) { - if (key in this.info) { + if (key === "sequence") { + this.info.sequence = Number(value) || undefined; + } else if (key in this.info) { this.info[key] = Boolean(value); } }