Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Process missing messages during reconnection #506

Merged
merged 3 commits into from
Jul 20, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix eslint
starwarfan committed Jun 2, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 005ffb3c71b341cb85b58f434e5b81fc6bf8f382
20 changes: 14 additions & 6 deletions src/sdk/conference/signaling.js
Original file line number Diff line number Diff line change
@@ -110,12 +110,13 @@ export class SioSignaling extends EventModule.EventDispatcher {
let isMissingStart = false;
for (const msg of data.messages) {
if (isMissingStart) {
this.dispatchEvent(new EventModule.MessageEvent('data', {
message: {
notification: msg.event,
data: msg.data,
},
}));
this.dispatchEvent(
new EventModule.MessageEvent('data', {
message: {
notification: msg.event,
data: msg.data,
},
}));
this._incrementMessageSequence();
} else if (msg.seq === this._messageSequence) {
isMissingStart = true;
@@ -225,6 +226,13 @@ export class SioSignaling extends EventModule.EventDispatcher {
this._refreshReconnectionTicket = null;
}

/**
* @function _clearReconnectionTask
* @instance
* @desc Increase the message sequence.
* @memberof Owt.Conference.SioSignaling
* @private.
*/
_incrementMessageSequence() {
if (this._messageSequence === maxSequence) {
this._messageSequence = 0;