Skip to content

Commit 03bf6a6

Browse files
[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]: odoo/odoo#205198
1 parent 3184fb1 commit 03bf6a6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/models/session.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
* @property {boolean} isSelfMuted
1818
* @property {boolean} isDeaf
1919
* @property {boolean} isRaisingHand
20+
* @property {number} sequence
2021
*/
2122

2223
/**
@@ -80,6 +81,7 @@ export class Session extends EventEmitter {
8081
isDeaf: undefined,
8182
isCameraOn: undefined,
8283
isScreenSharingOn: undefined,
84+
sequence: undefined,
8385
});
8486
/** @type {string} */
8587
remote;
@@ -564,7 +566,9 @@ export class Session extends EventEmitter {
564566
case CLIENT_MESSAGE.INFO_CHANGE:
565567
{
566568
for (const [key, value] of Object.entries(payload.info)) {
567-
if (key in this.info) {
569+
if (key === "sequence") {
570+
this.info.sequence = Number(value) || 0;
571+
} else if (key in this.info) {
568572
this.info[key] = Boolean(value);
569573
}
570574
}

0 commit comments

Comments
 (0)