livekit-client 1.13.1 → 1.13.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.
@@ -1098,6 +1098,7 @@ class FrameCryptor extends BaseFrameCryptor {
1098
1098
  if (isFrameServerInjected(encodedFrame.data, this.sifTrailer)) {
1099
1099
  this.sifGuard.recordSif();
1100
1100
  if (this.sifGuard.isSifAllowed()) {
1101
+ encodedFrame.data = encodedFrame.data.slice(0, encodedFrame.data.byteLength - this.sifTrailer.byteLength);
1101
1102
  return controller.enqueue(encodedFrame);
1102
1103
  } else {
1103
1104
  workerLogger.warn('SIF limit reached, dropping frame');
@@ -1118,7 +1119,7 @@ class FrameCryptor extends BaseFrameCryptor {
1118
1119
  } catch (error) {
1119
1120
  if (error instanceof CryptorError && error.reason === CryptorErrorReason.InvalidKey) {
1120
1121
  if (this.keys.hasValidKey) {
1121
- this.emit(CryptorEvent.Error, new CryptorError("invalid key for participant ".concat(this.participantIdentity), CryptorErrorReason.InvalidKey));
1122
+ this.emit(CryptorEvent.Error, error);
1122
1123
  this.keys.decryptionFailure();
1123
1124
  }
1124
1125
  } else {
@@ -1210,7 +1211,7 @@ class FrameCryptor extends BaseFrameCryptor {
1210
1211
  throw new CryptorError("valid key missing for participant ".concat(this.participantIdentity), CryptorErrorReason.InvalidKey);
1211
1212
  }
1212
1213
  } else {
1213
- throw new CryptorError('Decryption failed, most likely because of an invalid key', CryptorErrorReason.InvalidKey);
1214
+ throw new CryptorError("Decryption failed: ".concat(error.message), CryptorErrorReason.InvalidKey);
1214
1215
  }
1215
1216
  }
1216
1217
  });