@livedigital/client 3.44.2 → 3.44.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@livedigital/client",
3
3
  "author": "vlprojects",
4
4
  "license": "MIT",
5
- "version": "3.44.2",
5
+ "version": "3.44.3",
6
6
  "private": false,
7
7
  "bugs": {
8
8
  "url": "https://github.com/vlprojects/livedigital-sdk/issues"
@@ -76,7 +76,7 @@ class Engine {
76
76
  private readonly mark = randomString();
77
77
 
78
78
  private readonly handleSignalingError = (error: Error): void => {
79
- if (this.isReleasing) {
79
+ if (this.isReleasing || !this.isChannelJoined || this.state.isChannelJoining) {
80
80
  return;
81
81
  }
82
82
 
@@ -194,6 +194,7 @@ class Engine {
194
194
  this.state.reset();
195
195
  this.myPeer.delete();
196
196
  this.webRtcIssueDetector?.stopWatchingNewPeerConnections();
197
+
197
198
  await this.peers.reset();
198
199
 
199
200
  this.network.closeSendTransport();
@@ -212,18 +213,8 @@ class Engine {
212
213
 
213
214
  this.removeClientEventEmitterListeners();
214
215
 
215
- if (this.isChannelJoined) {
216
- try {
217
- await this.signalingApiClient.peers.disconnectPeer();
218
- } catch (error: unknown) {
219
- this.#logger.debug('failed to disconnect peer', {
220
- peerId: this.myPeerId,
221
- error: serializeError(error),
222
- });
223
- }
224
- }
225
-
226
216
  this.network.reset();
217
+ await this.signalingApiClient.peers.disconnectPeer();
227
218
  clientMetaProvider.clear();
228
219
  this.transportsStatsProvider.clear();
229
220
  this.statsHandler.clear();
@@ -232,6 +223,7 @@ class Engine {
232
223
  });
233
224
  } catch (error: unknown) {
234
225
  this.#logger.error('release()', { error });
226
+ throw new Error('Error release engine');
235
227
  } finally {
236
228
  this.isReleasing = false;
237
229
  }
@@ -675,7 +667,7 @@ class Engine {
675
667
  }
676
668
 
677
669
  private triggerRejoinEventIfAppropriate(reason?: string): void {
678
- if (this.rejoinRequested && !this.state.isChannelJoining) {
670
+ if (!this.isChannelJoined || this.isReleasing || this.state.isChannelJoining || this.rejoinRequested) {
679
671
  return;
680
672
  }
681
673