lunel-cli 0.1.92 → 0.1.93

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.
@@ -37,6 +37,7 @@ export declare class V2SessionTransport {
37
37
  private handleHandshakeFrame;
38
38
  private encryptEnvelope;
39
39
  private ensureKeyPair;
40
+ private resetPeerSession;
40
41
  private computeHandshakeAuth;
41
42
  private sendJsonFrame;
42
43
  private sendBinaryFrame;
@@ -124,6 +124,7 @@ export class V2SessionTransport {
124
124
  if ("type" in raw) {
125
125
  await this.options.handlers.onSystemMessage(raw);
126
126
  if (raw.type === "peer_connected") {
127
+ this.resetPeerSession();
127
128
  await this.maybeStartHandshake();
128
129
  }
129
130
  return;
@@ -290,6 +291,16 @@ export class V2SessionTransport {
290
291
  };
291
292
  return this.keyPair;
292
293
  }
294
+ resetPeerSession() {
295
+ this.remotePublicKey = null;
296
+ this.sessionKeys = null;
297
+ if (this.ws?.readyState === WebSocket.OPEN) {
298
+ this.state = "open";
299
+ }
300
+ else {
301
+ this.state = "idle";
302
+ }
303
+ }
293
304
  computeHandshakeAuth(phase, senderRole, peerPubkeyB64, nonce, boxed) {
294
305
  const authKey = sodium.crypto_generichash(sodium.crypto_auth_KEYBYTES, encodeUtf8(this.options.sessionCode), undefined);
295
306
  const parts = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lunel-cli",
3
- "version": "0.1.92",
3
+ "version": "0.1.93",
4
4
  "author": [
5
5
  {
6
6
  "name": "Soham Bharambe",