@agentvault/agentvault 0.14.27 → 0.14.28

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/dist/index.js CHANGED
@@ -49370,11 +49370,16 @@ ${messageText}`;
49370
49370
  ciphertext: data.ciphertext
49371
49371
  });
49372
49372
  let distJson;
49373
+ const ratchetSnapshot = session.ratchet.serialize();
49373
49374
  try {
49374
49375
  distJson = session.ratchet.decrypt(encrypted);
49375
49376
  } catch (err) {
49377
+ session.ratchet = DoubleRatchet.deserialize(ratchetSnapshot);
49378
+ if (this._persisted?.sessions[convId]) {
49379
+ this._persisted.sessions[convId].ratchetState = ratchetSnapshot;
49380
+ }
49376
49381
  console.warn(
49377
- `[SecureChannel] Failed to decrypt sender key distribution from ${data.sender_device_id.slice(0, 8)}...:`,
49382
+ `[SecureChannel] Failed to decrypt sender key distribution from ${data.sender_device_id.slice(0, 8)}... (ratchet restored):`,
49378
49383
  err
49379
49384
  );
49380
49385
  return;