@matter/protocol 0.17.2 → 0.17.3-alpha.0-20260614-888c310c5

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.
Files changed (81) hide show
  1. package/dist/cjs/action/client/ClientInteraction.d.ts.map +1 -1
  2. package/dist/cjs/action/client/ClientInteraction.js +7 -1
  3. package/dist/cjs/action/client/ClientInteraction.js.map +1 -1
  4. package/dist/cjs/action/client/ClientRequest.d.ts +8 -1
  5. package/dist/cjs/action/client/ClientRequest.d.ts.map +1 -1
  6. package/dist/cjs/peer/Peer.d.ts +5 -0
  7. package/dist/cjs/peer/Peer.d.ts.map +1 -1
  8. package/dist/cjs/peer/Peer.js +1 -0
  9. package/dist/cjs/peer/Peer.js.map +1 -1
  10. package/dist/cjs/peer/PeerConnection.d.ts +6 -1
  11. package/dist/cjs/peer/PeerConnection.d.ts.map +1 -1
  12. package/dist/cjs/peer/PeerConnection.js +23 -5
  13. package/dist/cjs/peer/PeerConnection.js.map +1 -1
  14. package/dist/cjs/peer/PeerExchangeProvider.d.ts.map +1 -1
  15. package/dist/cjs/peer/PeerExchangeProvider.js +3 -0
  16. package/dist/cjs/peer/PeerExchangeProvider.js.map +1 -1
  17. package/dist/cjs/peer/PeerTimingParameters.d.ts +9 -0
  18. package/dist/cjs/peer/PeerTimingParameters.d.ts.map +1 -1
  19. package/dist/cjs/peer/PeerTimingParameters.js +3 -1
  20. package/dist/cjs/peer/PeerTimingParameters.js.map +1 -1
  21. package/dist/cjs/protocol/ExchangeProvider.d.ts +6 -1
  22. package/dist/cjs/protocol/ExchangeProvider.d.ts.map +1 -1
  23. package/dist/cjs/protocol/ExchangeProvider.js +4 -2
  24. package/dist/cjs/protocol/ExchangeProvider.js.map +1 -1
  25. package/dist/cjs/protocol/MRP.d.ts +1 -1
  26. package/dist/cjs/protocol/MRP.d.ts.map +1 -1
  27. package/dist/cjs/protocol/MRP.js +1 -2
  28. package/dist/cjs/protocol/MRP.js.map +1 -1
  29. package/dist/cjs/protocol/MessageExchange.d.ts +14 -1
  30. package/dist/cjs/protocol/MessageExchange.d.ts.map +1 -1
  31. package/dist/cjs/protocol/MessageExchange.js +31 -5
  32. package/dist/cjs/protocol/MessageExchange.js.map +1 -1
  33. package/dist/cjs/session/pase/PaseServer.d.ts.map +1 -1
  34. package/dist/cjs/session/pase/PaseServer.js +11 -2
  35. package/dist/cjs/session/pase/PaseServer.js.map +1 -1
  36. package/dist/esm/action/client/ClientInteraction.d.ts.map +1 -1
  37. package/dist/esm/action/client/ClientInteraction.js +7 -1
  38. package/dist/esm/action/client/ClientInteraction.js.map +1 -1
  39. package/dist/esm/action/client/ClientRequest.d.ts +8 -1
  40. package/dist/esm/action/client/ClientRequest.d.ts.map +1 -1
  41. package/dist/esm/peer/Peer.d.ts +5 -0
  42. package/dist/esm/peer/Peer.d.ts.map +1 -1
  43. package/dist/esm/peer/Peer.js +1 -0
  44. package/dist/esm/peer/Peer.js.map +1 -1
  45. package/dist/esm/peer/PeerConnection.d.ts +6 -1
  46. package/dist/esm/peer/PeerConnection.d.ts.map +1 -1
  47. package/dist/esm/peer/PeerConnection.js +23 -5
  48. package/dist/esm/peer/PeerConnection.js.map +1 -1
  49. package/dist/esm/peer/PeerExchangeProvider.d.ts.map +1 -1
  50. package/dist/esm/peer/PeerExchangeProvider.js +3 -0
  51. package/dist/esm/peer/PeerExchangeProvider.js.map +1 -1
  52. package/dist/esm/peer/PeerTimingParameters.d.ts +9 -0
  53. package/dist/esm/peer/PeerTimingParameters.d.ts.map +1 -1
  54. package/dist/esm/peer/PeerTimingParameters.js +4 -2
  55. package/dist/esm/peer/PeerTimingParameters.js.map +1 -1
  56. package/dist/esm/protocol/ExchangeProvider.d.ts +6 -1
  57. package/dist/esm/protocol/ExchangeProvider.d.ts.map +1 -1
  58. package/dist/esm/protocol/ExchangeProvider.js +4 -2
  59. package/dist/esm/protocol/ExchangeProvider.js.map +1 -1
  60. package/dist/esm/protocol/MRP.d.ts +1 -1
  61. package/dist/esm/protocol/MRP.d.ts.map +1 -1
  62. package/dist/esm/protocol/MRP.js +1 -2
  63. package/dist/esm/protocol/MRP.js.map +1 -1
  64. package/dist/esm/protocol/MessageExchange.d.ts +14 -1
  65. package/dist/esm/protocol/MessageExchange.d.ts.map +1 -1
  66. package/dist/esm/protocol/MessageExchange.js +31 -5
  67. package/dist/esm/protocol/MessageExchange.js.map +1 -1
  68. package/dist/esm/session/pase/PaseServer.d.ts.map +1 -1
  69. package/dist/esm/session/pase/PaseServer.js +12 -2
  70. package/dist/esm/session/pase/PaseServer.js.map +1 -1
  71. package/package.json +5 -5
  72. package/src/action/client/ClientInteraction.ts +7 -0
  73. package/src/action/client/ClientRequest.ts +9 -1
  74. package/src/peer/Peer.ts +7 -0
  75. package/src/peer/PeerConnection.ts +33 -6
  76. package/src/peer/PeerExchangeProvider.ts +4 -0
  77. package/src/peer/PeerTimingParameters.ts +15 -2
  78. package/src/protocol/ExchangeProvider.ts +12 -2
  79. package/src/protocol/MRP.ts +5 -6
  80. package/src/protocol/MessageExchange.ts +44 -6
  81. package/src/session/pase/PaseServer.ts +12 -2
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/session/pase/PaseServer.ts"],
4
- "mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,SAAS,YAAY;AAErB;AAAA,EACI;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OACG;AACP,SAAS,QAAQ,4BAA4B,+BAA+B;AAG5E,SAAS,kCAAkC;AAC3C,SAAS,qBAAqB,qBAAqB,qBAAqB;AAExE,MAAM,SAAS,OAAO,IAAI,YAAY;AAEtC,MAAM,uBAAuB,QAAQ,EAAE;AACvC,MAAM,gCAAgC;AAE/B,MAAM,6CAA6C,gBAAgB;AAAC;AAEpE,MAAM,WAAsC;AAAA,EAyB/C,YACY,UACS,IACA,GACA,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uB;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,MACH,QAAQ;AAAA,MACR;AAAA,MACA,WAAW,OAAO,UAAU,WAAW;AAAA,MACvC,UAAU,SAAS;AAAA,IACvB;AAEA,UAAM,UAAU,YAAY;AAC5B,UAAM,UAAU,MAAM;AAAA,EAC1B;AAAA,EAEA,MAAM,cAAc,WAAgC,YAAY,MAAM;AAClE,QAAI,WAAW;AACX,UAAI;AACA,cAAM,UAAU,UAAU,wBAAwB,YAAY;AAAA,MAClE,SAAS,OAAO;AACZ,eAAO;AAAA,UACH;AAAA,UACA,WAAW,aAAa,QAAQ,KAAK,CAAC;AAAA,QAC1C;AAAA,MACJ;AAAA,IACJ;AACA,UAAM,UAAU,MAAM;AAAA,EAC1B;AAAA,EAEA,MAAM,QAAQ;AACV,SAAK,UAAU;AACf,UAAM,KAAK,mBAAmB,MAAM;AAAA,EACxC;AACJ;",
5
5
  "names": []
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matter/protocol",
3
- "version": "0.17.2",
3
+ "version": "0.17.3-alpha.0-20260614-888c310c5",
4
4
  "description": "Low-level APIs for Matter interaction",
5
5
  "keywords": [
6
6
  "iot",
@@ -35,12 +35,12 @@
35
35
  "#*": "./src/*"
36
36
  },
37
37
  "dependencies": {
38
- "@matter/general": "0.17.2",
39
- "@matter/model": "0.17.2",
40
- "@matter/types": "0.17.2"
38
+ "@matter/general": "0.17.3-alpha.0-20260614-888c310c5",
39
+ "@matter/model": "0.17.3-alpha.0-20260614-888c310c5",
40
+ "@matter/types": "0.17.3-alpha.0-20260614-888c310c5"
41
41
  },
42
42
  "devDependencies": {
43
- "@matter/testing": "0.17.2"
43
+ "@matter/testing": "0.17.3-alpha.0-20260614-888c310c5"
44
44
  },
45
45
  "files": [
46
46
  "dist/**/*",
@@ -97,6 +97,7 @@ interface PendingCommand {
97
97
  request: Invoke.ConcreteCommandRequest<any>;
98
98
  pathKey: string;
99
99
  network?: string;
100
+ additionalMrpDelay?: Duration;
100
101
  resolve: (entry: InvokeResult.DecodedData | undefined) => void;
101
102
  reject: (error: Error) => void;
102
103
  aborted?: boolean;
@@ -612,6 +613,7 @@ export class ClientInteraction<
612
613
  request: { ...cmd, commandRef } as Invoke.ConcreteCommandRequest<any>,
613
614
  pathKey,
614
615
  network: request.network,
616
+ additionalMrpDelay: request.additionalMrpDelay,
615
617
  resolve: resolver,
616
618
  reject: rejecter,
617
619
  };
@@ -764,6 +766,9 @@ export class ClientInteraction<
764
766
  // Preserve the network profile from the queued commands (all commands in a batch share the same
765
767
  // ClientInteraction so they will normally have the same network; pick the first defined value)
766
768
  const batchNetwork = commandList.find(c => c.network !== undefined)?.network;
769
+ const batchAdditionalMrpDelay = commandList.find(
770
+ c => c.additionalMrpDelay !== undefined,
771
+ )?.additionalMrpDelay;
767
772
 
768
773
  // Use #invokeSingle directly to avoid re-entering the batching path in invoke()
769
774
  // Skip validation: already validated on submit. timed=false: only non-timed commands
@@ -771,6 +776,7 @@ export class ClientInteraction<
771
776
  const batchRequest = {
772
777
  ...Invoke({ commands: invokeRequests, skipValidation: true, timed: false }),
773
778
  network: batchNetwork,
779
+ additionalMrpDelay: batchAdditionalMrpDelay,
774
780
  } as ClientInvoke;
775
781
  const maxPathsPerInvoke = this.#exchangeProvider.maxPathsPerInvoke ?? 1;
776
782
  const chunks =
@@ -1037,6 +1043,7 @@ export class ClientInteraction<
1037
1043
  try {
1038
1044
  messenger = await InteractionClientMessenger.create(this.#exchangeProvider, {
1039
1045
  network: request.network ?? this.#network,
1046
+ additionalMrpDelay: request.additionalMrpDelay,
1040
1047
  abort,
1041
1048
  connectionTimeout: session?.connectionTimeout,
1042
1049
  addressOverride: request.addressOverride,
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import type { NetworkProfile } from "#peer/NetworkProfile.js";
8
- import type { ServerAddressUdp } from "@matter/general";
8
+ import type { Duration, ServerAddressUdp } from "@matter/general";
9
9
 
10
10
  /**
11
11
  * Represents a client request with customizable transmission behavior.
@@ -23,6 +23,14 @@ export interface ClientRequest {
23
23
  */
24
24
  network?: string;
25
25
 
26
+ /**
27
+ * Override the peer-medium MRP retransmission margin for this interaction.
28
+ *
29
+ * By default the margin derives from the peer's network medium (e.g. thread's longer margin), independent of
30
+ * the {@link network} throttle profile. Set this to override that default for a single interaction.
31
+ */
32
+ additionalMrpDelay?: Duration;
33
+
26
34
  /**
27
35
  * Override the destination address for this interaction's exchange.
28
36
  *
package/src/peer/Peer.ts CHANGED
@@ -579,6 +579,7 @@ export class Peer {
579
579
 
580
580
  done: PeerConnection(this, this.#context, {
581
581
  network: options?.network,
582
+ additionalMrpDelay: options?.additionalMrpDelay,
582
583
  timing: options?.timing,
583
584
  requiredTransport: options?.requiredTransport,
584
585
  preferredTransport: options?.preferredTransport,
@@ -621,6 +622,12 @@ export namespace Peer {
621
622
  */
622
623
  network?: string;
623
624
 
625
+ /**
626
+ * Per-call override for the peer-medium MRP retransmission margin. When omitted the margin derives from
627
+ * the peer's network medium, independent of any {@link network} throttle override.
628
+ */
629
+ additionalMrpDelay?: Duration;
630
+
624
631
  /**
625
632
  * A timeout relative to beginning of connection process.
626
633
  *
@@ -109,6 +109,9 @@ export async function PeerConnection(
109
109
 
110
110
  // Reserve network communication slot
111
111
  let network = context.networks.select(peer, options?.network);
112
+ const mediumProfile = context.networks.forPeer(peer);
113
+ const peerAdditionalMrpDelay =
114
+ options?.additionalMrpDelay ?? mediumProfile.connect?.additionalMrpDelay ?? mediumProfile.additionalMrpDelay;
112
115
  if (network.connect) {
113
116
  network = network.connect;
114
117
  }
@@ -303,8 +306,7 @@ export async function PeerConnection(
303
306
  return;
304
307
  }
305
308
  const variants = expandAddresses(fallback);
306
- // The interned first variant is the fallback marker; reference equality
307
- // must match what comes back out of pendingAddresses.
309
+ // Intern so attempts/pendingAddresses key on one canonical object; fallback identity is matched by value.
308
310
  attemptingFallback = addresses.add(variants[0]);
309
311
  for (const variant of variants) {
310
312
  pendingAddresses.add(variant);
@@ -406,7 +408,7 @@ export async function PeerConnection(
406
408
 
407
409
  // If this is not the fallback address but we're still attempting to connect to the fallback, it means that
408
410
  // we've discovered addresses that do not include the fallback; terminate the fallback attempt
409
- if (attemptingFallback && address !== attemptingFallback) {
411
+ if (attemptingFallback && !ServerAddress.isEqual(address, attemptingFallback)) {
410
412
  deleteAddress(
411
413
  attemptingFallback,
412
414
  "Aborting attempt to last known address because device reports address change",
@@ -456,7 +458,13 @@ export async function PeerConnection(
456
458
  isInitiator: true,
457
459
  });
458
460
 
459
- await using exchange = PeerConnection.createExchange(peer, context.exchanges, unsecuredSession, network);
461
+ await using exchange = PeerConnection.createExchange(
462
+ peer,
463
+ context.exchanges,
464
+ unsecuredSession,
465
+ network,
466
+ peerAdditionalMrpDelay,
467
+ );
460
468
 
461
469
  info(
462
470
  Diagnostic.via(`${peer.address.toString()}${exchange.via}`),
@@ -470,7 +478,7 @@ export async function PeerConnection(
470
478
  }),
471
479
  Diagnostic.asFlags({
472
480
  [network.id]: true,
473
- fallback: address === attemptingFallback,
481
+ fallback: attemptingFallback !== undefined && ServerAddress.isEqual(address, attemptingFallback),
474
482
  }),
475
483
  );
476
484
 
@@ -492,6 +500,11 @@ export async function PeerConnection(
492
500
  return;
493
501
  }
494
502
 
503
+ if (exchange.retransmissionRestartSaving < context.timing.kickMinRestartSaving) {
504
+ debug(via, address, `Suppressing "${origin}" kick, restart would save too little time`);
505
+ return;
506
+ }
507
+
495
508
  const threshold =
496
509
  origin === "discover"
497
510
  ? context.timing.kickRestartCooldown.addressChange
@@ -691,6 +704,13 @@ export namespace PeerConnection {
691
704
  export interface Options {
692
705
  abort?: AbortSignal;
693
706
  network?: string;
707
+
708
+ /**
709
+ * Per-call override for the peer-medium MRP retransmission margin. When omitted the margin derives from
710
+ * the peer's network medium, independent of any {@link network} throttle override.
711
+ */
712
+ additionalMrpDelay?: Duration;
713
+
694
714
  kicker?: Observable<[KickOrigin]>;
695
715
 
696
716
  /** See {@link Peer.ConnectOptions.requiredTransport}. */
@@ -718,10 +738,17 @@ export namespace PeerConnection {
718
738
  exchanges: ExchangeManager,
719
739
  session: Session,
720
740
  network: NetworkProfile,
741
+ peerAdditionalMrpDelay?: Duration,
721
742
  protocol = SECURE_CHANNEL_PROTOCOL_ID,
722
743
  addressOverride?: ServerAddressUdp,
723
744
  ) {
724
- return exchanges.initiateExchangeForSession(session, protocol, { onSend, onReceive, network, addressOverride });
745
+ return exchanges.initiateExchangeForSession(session, protocol, {
746
+ onSend,
747
+ onReceive,
748
+ network,
749
+ peerAdditionalMrpDelay,
750
+ addressOverride,
751
+ });
725
752
 
726
753
  function onSend(_message: Message, retransmission: number) {
727
754
  if (retransmission) {
@@ -51,6 +51,7 @@ export class PeerExchangeProvider extends ExchangeProvider {
51
51
  await this.#peer.connect({
52
52
  abort: options?.abort,
53
53
  network: options?.network,
54
+ additionalMrpDelay: options?.additionalMrpDelay,
54
55
  connectionTimeout: options?.connectionTimeout,
55
56
  requiredTransport: options?.requiredTransport,
56
57
  preferredTransport: options?.preferredTransport,
@@ -72,6 +73,8 @@ export class PeerExchangeProvider extends ExchangeProvider {
72
73
  }
73
74
 
74
75
  const network = this.#context.networks.select(this.#peer, options?.network);
76
+ const peerAdditionalMrpDelay =
77
+ options?.additionalMrpDelay ?? this.#context.networks.forPeer(this.#peer).additionalMrpDelay;
75
78
  const slot = await network.semaphore.obtainSlot(abort);
76
79
 
77
80
  try {
@@ -112,6 +115,7 @@ export class PeerExchangeProvider extends ExchangeProvider {
112
115
  this.#context.exchanges,
113
116
  session,
114
117
  network,
118
+ peerAdditionalMrpDelay,
115
119
  options?.protocol ?? INTERACTION_PROTOCOL_ID,
116
120
  options?.addressOverride,
117
121
  );
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import { Duration, merge as mergeObjects, Minutes, Seconds } from "@matter/general";
7
+ import { Duration, merge as mergeObjects, Millis, Minutes, Seconds } from "@matter/general";
8
8
 
9
9
  /**
10
10
  * Parameters that control network timing for Matter sessions controlled by matter.js.
@@ -72,6 +72,16 @@ export interface PeerTimingParameters {
72
72
  */
73
73
  kickMinRetransmissions: number;
74
74
 
75
+ /**
76
+ * Minimum time a kick-initiated restart must shave off the next retransmission to be worthwhile.
77
+ *
78
+ * Restarting resets MRP backoff to its base interval, so it only helps once backoff has grown well
79
+ * beyond that base. A kick whose restart would save less than this is suppressed — for an idle/sleepy
80
+ * peer the base interval is already large, so a restart gains nothing and needlessly tears down the
81
+ * in-flight exchange.
82
+ */
83
+ kickMinRestartSaving: Duration;
84
+
75
85
  /**
76
86
  * Per-trigger cooldowns for kick-initiated CASE exchange restarts.
77
87
  *
@@ -151,10 +161,12 @@ export namespace PeerTimingParameters {
151
161
  return result;
152
162
  }
153
163
 
164
+ const maxInitialContactRetryInterval = Minutes(2);
165
+
154
166
  // TODO - tune these
155
167
  export const defaults: PeerTimingParameters = {
156
168
  defaultConnectionTimeout: Seconds(90),
157
- maxDelayBetweenInitialContactRetries: Minutes(2),
169
+ maxDelayBetweenInitialContactRetries: maxInitialContactRetryInterval,
158
170
 
159
171
  // We assume 30s processing time on peer for single Sigma actions, so give one IP a bit of time
160
172
  // to have a chance before potentially adding a load with a second try
@@ -164,6 +176,7 @@ export namespace PeerTimingParameters {
164
176
  delayAfterUnhandledError: Minutes(2),
165
177
  kickThrottleInterval: Seconds(3),
166
178
  kickMinRetransmissions: 2,
179
+ kickMinRestartSaving: Millis(maxInitialContactRetryInterval / 2),
167
180
  kickRestartCooldown: {
168
181
  addressChange: Minutes(30),
169
182
  connect: Minutes(10),
@@ -32,6 +32,12 @@ export interface NewExchangeOptions extends Omit<InteractionSettings, "transacti
32
32
  */
33
33
  network?: string;
34
34
 
35
+ /**
36
+ * Per-call override for the peer-medium MRP retransmission margin. When omitted the margin derives from the
37
+ * peer's network medium, independent of any {@link network} throttle override.
38
+ */
39
+ additionalMrpDelay?: Duration;
40
+
35
41
  /**
36
42
  * Optional address override for the exchange. When set, messages are sent to this address
37
43
  * instead of the session's default peer address.
@@ -100,8 +106,12 @@ export class DedicatedChannelExchangeProvider extends ExchangeProvider {
100
106
  return this.#session.parameters.maxPathsPerInvoke;
101
107
  }
102
108
 
103
- async initiateExchange(): Promise<MessageExchange> {
104
- return this.exchangeManager.initiateExchangeForSession(this.#session, INTERACTION_PROTOCOL_ID);
109
+ async initiateExchange(options?: NewExchangeOptions): Promise<MessageExchange> {
110
+ // This provider has no peer/medium context, so the medium-derived margin is unavailable; only an explicit
111
+ // per-call override can apply here.
112
+ return this.exchangeManager.initiateExchangeForSession(this.#session, INTERACTION_PROTOCOL_ID, {
113
+ peerAdditionalMrpDelay: options?.additionalMrpDelay,
114
+ });
105
115
  }
106
116
 
107
117
  get channelType() {
@@ -20,7 +20,7 @@ export namespace MRP {
20
20
  /** The scaler for random jitter in the backoff equation. */
21
21
  export const BACKOFF_JITTER = 0.25;
22
22
 
23
- /** The scaler margin increase to backoff over the peer sleepy interval. */
23
+ /** The scaler margin increase to backoff over the applicable (active/idle) interval. */
24
24
  export const BACKOFF_MARGIN = 1.1;
25
25
 
26
26
  /** The number of retransmissions before transitioning from linear to exponential backoff. */
@@ -128,11 +128,10 @@ export namespace MRP {
128
128
  ) {
129
129
  const { activeInterval, idleInterval } = sessionParameters;
130
130
 
131
- // The first message of an exchange SHALL use the idle interval; subsequent ones SHOULD use the active
132
- // interval "unless the sender has other means to determine whether the device is active or idle" —
133
- // isPeerActive is that means, so honor it per retransmission like CHIP does (ICD correctness)
134
- const peerActive = transmissionNumber > 0 && isPeerActive;
135
- let baseInterval = peerActive ? activeInterval : idleInterval;
131
+ // Every transmission (including the initial one) selects its interval by PeerActiveMode, re-evaluated
132
+ // per (re)transmission, matching CHIP GetMRPBaseTimeout(). isPeerActive already yields idle for a
133
+ // genuinely quiet peer, so no position-based first-message rule is needed.
134
+ let baseInterval = isPeerActive ? activeInterval : idleInterval;
136
135
  if (!calculateMaximum) {
137
136
  baseInterval += additionalDelay;
138
137
  }
@@ -199,7 +199,7 @@ export class MessageExchange {
199
199
  readonly #onSend?: MessageExchange.SendNotifier;
200
200
  readonly #onReceive?: MessageExchange.ReceiveNotifier;
201
201
  readonly #addressOverride?: ServerAddressUdp;
202
- readonly #network?: NetworkProfile;
202
+ readonly #peerAdditionalMrpDelay?: Duration;
203
203
  #receivedMessageToAck: Message | undefined;
204
204
  #receivedMessageAckTimer = Time.getTimer("ack receipt timeout", MRP.STANDALONE_ACK_TIMEOUT, () => {
205
205
  if (this.#receivedMessageToAck !== undefined) {
@@ -251,6 +251,7 @@ export class MessageExchange {
251
251
  onSend,
252
252
  onReceive,
253
253
  network,
254
+ peerAdditionalMrpDelay,
254
255
  addressOverride,
255
256
  } = config;
256
257
 
@@ -264,7 +265,7 @@ export class MessageExchange {
264
265
  this.#onSend = onSend;
265
266
  this.#onReceive = onReceive;
266
267
  this.#addressOverride = addressOverride;
267
- this.#network = network;
268
+ this.#peerAdditionalMrpDelay = peerAdditionalMrpDelay;
268
269
 
269
270
  const { activeThreshold, activeInterval, idleInterval } = this.session.parameters;
270
271
 
@@ -991,12 +992,22 @@ export class MessageExchange {
991
992
  }
992
993
 
993
994
  get #mrpResubmissionBackOffTime() {
995
+ return this.#backOffFor(this.#retransmissionCounter);
996
+ }
997
+
998
+ /**
999
+ * Scheduled MRP backoff for a given (re)transmission number, after the send-option overrides.
1000
+ *
1001
+ * The cap never drops below the peer's idle interval: a peer whose idle base backoff already exceeds
1002
+ * maxRetransmissionTime must not be retried faster than its own idle cadence.
1003
+ */
1004
+ #backOffFor(retransmissionCount: number) {
994
1005
  const additionalDelay = Duration.max(
995
1006
  this.#context.localAdditionalMrpDelay,
996
- this.#network?.additionalMrpDelay ?? Millis(0),
1007
+ this.#peerAdditionalMrpDelay ?? Millis(0),
997
1008
  );
998
1009
  let backOff = this.channel.getMrpResubmissionBackOffTime(
999
- this.#retransmissionCounter,
1010
+ retransmissionCount,
1000
1011
  undefined,
1001
1012
  false,
1002
1013
  additionalDelay,
@@ -1004,7 +1015,26 @@ export class MessageExchange {
1004
1015
  if (this.#sendOptions.initialRetransmissionTime !== undefined) {
1005
1016
  backOff = Millis(backOff + this.#sendOptions.initialRetransmissionTime);
1006
1017
  }
1007
- return Duration.min(backOff, this.#sendOptions.maxRetransmissionTime ?? Forever);
1018
+ const cap = Duration.max(
1019
+ this.#sendOptions.maxRetransmissionTime ?? Forever,
1020
+ this.session.parameters.idleInterval ?? Instant,
1021
+ );
1022
+ return Duration.min(backOff, cap);
1023
+ }
1024
+
1025
+ /**
1026
+ * How much restarting the exchange (resetting the retransmission counter to 0) would shorten the wait until
1027
+ * the next (re)transmission. Roughly zero near the base interval — e.g. an idle peer, whose fresh interval is
1028
+ * just as slow.
1029
+ */
1030
+ get retransmissionRestartSaving(): Duration {
1031
+ // No pending retransmit → nothing for a restart to shorten → report no saving so the kick is suppressed.
1032
+ const currentWait = this.#retransmissionTimer?.interval;
1033
+ if (currentWait === undefined) {
1034
+ return Instant;
1035
+ }
1036
+ // Read the live timer's real interval (margins/jitter/cap baked in), not a freshly recomputed random one.
1037
+ return Duration.max(Instant, Millis(currentWait - this.#backOffFor(0)));
1008
1038
  }
1009
1039
  }
1010
1040
 
@@ -1021,10 +1051,18 @@ export namespace MessageExchange {
1021
1051
  onReceive?: ReceiveNotifier;
1022
1052
 
1023
1053
  /**
1024
- * Network Profile used
1054
+ * Network profile governing exchange throttling. Retained for diagnostics; MRP backoff derives from
1055
+ * {@link peerAdditionalMrpDelay} instead, so an explicit throttle override (e.g. "unlimited") does not
1056
+ * affect retransmission timing.
1025
1057
  */
1026
1058
  network?: NetworkProfile;
1027
1059
 
1060
+ /**
1061
+ * Additive MRP retransmission margin for the peer's network medium. Sourced independently of
1062
+ * {@link network} so concurrency overrides cannot strip the medium-correct margin (e.g. thread's).
1063
+ */
1064
+ peerAdditionalMrpDelay?: Duration;
1065
+
1028
1066
  /**
1029
1067
  * Optional address override for this exchange. When set, messages are sent to this address
1030
1068
  * instead of the session's default peer address.
@@ -7,6 +7,7 @@
7
7
  import { Mark } from "#common/Mark.js";
8
8
  import { SessionManager } from "#session/SessionManager.js";
9
9
  import {
10
+ asError,
10
11
  Bytes,
11
12
  causedBy,
12
13
  Channel,
@@ -124,7 +125,9 @@ export class PaseServer implements ProtocolHandler {
124
125
  logger.info("Received pairing request", Mark.INBOUND, Diagnostic.via(messenger.channelName));
125
126
 
126
127
  this.#pairingTimer = Time.getTimer("PASE pairing timeout", PASE_PAIRING_TIMEOUT, () =>
127
- this.cancelPairing(messenger),
128
+ this.cancelPairing(messenger).catch(error =>
129
+ logger.warn("Error cancelling PASE pairing after timeout:", Diagnostic.errorMessage(asError(error))),
130
+ ),
128
131
  ).start();
129
132
 
130
133
  // Read pbkdfRequest and send pbkdfResponse
@@ -203,7 +206,14 @@ export class PaseServer implements ProtocolHandler {
203
206
 
204
207
  async cancelPairing(messenger: PaseServerMessenger, sendError = true) {
205
208
  if (sendError) {
206
- await messenger.sendError(SecureChannelStatusCode.InvalidParam);
209
+ try {
210
+ await messenger.sendError(SecureChannelStatusCode.InvalidParam);
211
+ } catch (error) {
212
+ logger.info(
213
+ "Could not send pairing-cancellation status report to peer:",
214
+ Diagnostic.errorMessage(asError(error)),
215
+ );
216
+ }
207
217
  }
208
218
  await messenger.close();
209
219
  }