@camstack/addon-provider-reolink 1.2.262 → 1.2.263

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/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.263] - 2026-11-25
11
+
12
+ ### Changed
13
+
14
+ - A stream that stalls because one packet never arrived is now logged with the missing packet and how long media was withheld
15
+
10
16
  ## [1.2.262] - 2026-11-25
11
17
 
12
18
  ### Changed
package/dist/addon.js CHANGED
@@ -29165,7 +29165,7 @@ var require_lz4 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
29165
29165
  };
29166
29166
  }));
29167
29167
  //#endregion
29168
- //#region node_modules/@apocaliss92/nodelink-js/dist/chunk-NFHCFWUF.js
29168
+ //#region node_modules/@apocaliss92/nodelink-js/dist/chunk-7P5XTMMX.js
29169
29169
  var import_fxp = require_fxp();
29170
29170
  var import_lz4 = /* @__PURE__ */ require_chunk.__toESM(require_lz4(), 1);
29171
29171
  function bcHeaderLen(messageClass, buf, bodyLen) {
@@ -29990,6 +29990,9 @@ var BcUdpStream = class extends events.EventEmitter {
29990
29990
  received = /* @__PURE__ */ new Map();
29991
29991
  sent = /* @__PURE__ */ new Map();
29992
29992
  ackTimer;
29993
+ /** When delivery first became blocked by a missing packet (head-of-line). */
29994
+ holSinceMs;
29995
+ holStallLogged = false;
29993
29996
  resendTimer;
29994
29997
  hbTimer;
29995
29998
  discoveryTid;
@@ -30922,7 +30925,12 @@ var BcUdpStream = class extends events.EventEmitter {
30922
30925
  lastAckRxAgoMs: this.lastAckRxAtMs !== void 0 ? now - this.lastAckRxAtMs : void 0,
30923
30926
  unackedPackets: this.sent.size,
30924
30927
  ...oldestUnackedAgeMs !== void 0 ? { oldestUnackedAgeMs } : {},
30925
- discFromCamera: this.discFromCameraAtMs !== void 0
30928
+ discFromCamera: this.discFromCameraAtMs !== void 0,
30929
+ ...this.holSinceMs !== void 0 && this.received.size > 0 ? {
30930
+ holBlockedMs: now - this.holSinceMs,
30931
+ holMissingPacketId: this.packetsWant
30932
+ } : {},
30933
+ holBufferedPackets: this.received.size
30926
30934
  };
30927
30935
  }
30928
30936
  /**
@@ -30933,6 +30941,12 @@ var BcUdpStream = class extends events.EventEmitter {
30933
30941
  checkStalls(now) {
30934
30942
  const age = this.connectedAtMs !== void 0 ? now - this.connectedAtMs : void 0;
30935
30943
  const diag = this.getSessionDiagnostics(now);
30944
+ const holStalled = diag.holBlockedMs !== void 0 && diag.holBlockedMs >= 1500;
30945
+ if (holStalled && !this.holStallLogged) {
30946
+ this.holStallLogged = true;
30947
+ this.discoveryLogger?.warn?.(`[BcUdpStream] head-of-line stall: packet ${diag.holMissingPacketId} missing for ${diag.holBlockedMs}ms, ${diag.holBufferedPackets} later packet(s) withheld, lastDataRxAgoMs=${diag.lastDataRxAgoMs ?? "none"} sessionAgeMs=${age}`);
30948
+ this.emit("debug", "hol_stall", { ...diag });
30949
+ } else if (!holStalled) this.holStallLogged = false;
30936
30950
  const ackStalled = diag.oldestUnackedAgeMs !== void 0 && diag.oldestUnackedAgeMs >= 5e3;
30937
30951
  if (ackStalled && !this.ackWindowStallLogged) {
30938
30952
  this.ackWindowStallLogged = true;
@@ -30977,6 +30991,10 @@ var BcUdpStream = class extends events.EventEmitter {
30977
30991
  }
30978
30992
  });
30979
30993
  }
30994
+ trackHeadOfLine(now) {
30995
+ if (!(this.received.size > 0 && !this.received.has(this.packetsWant))) this.holSinceMs = void 0;
30996
+ else if (this.holSinceMs === void 0) this.holSinceMs = now;
30997
+ }
30980
30998
  flushReceived() {
30981
30999
  while (this.received.has(this.packetsWant)) {
30982
31000
  const chunk = this.received.get(this.packetsWant);
@@ -31019,6 +31037,7 @@ var BcUdpStream = class extends events.EventEmitter {
31019
31037
  if (p.packetId >= this.packetsWant) {
31020
31038
  this.received.set(p.packetId, p.payload);
31021
31039
  this.flushReceived();
31040
+ this.trackHeadOfLine(Date.now());
31022
31041
  this.updateAckPacket();
31023
31042
  if (this.packetsWant % 100 === 0) this.emit("debug", "udp_progress", { packetsWant: this.packetsWant });
31024
31043
  }
@@ -122821,7 +122840,8 @@ var BaseDevice = class {
122821
122840
  if (!this.statusIsExternal) {
122822
122841
  const seed = {
122823
122842
  online: true,
122824
- lastChangedAt: Date.now()
122843
+ lastChangedAt: Date.now(),
122844
+ unknown: true
122825
122845
  };
122826
122846
  this.runtimeState.setCapState("device-status", seed);
122827
122847
  }
@@ -122863,10 +122883,13 @@ var BaseDevice = class {
122863
122883
  * override to gate side effects on the transition.
122864
122884
  */
122865
122885
  markOnline(online) {
122866
- if (this.statusIsExternal || this.online === online) return;
122886
+ if (this.statusIsExternal) return;
122887
+ const prior = this.runtimeState.getCapState("device-status");
122888
+ const presumed = prior?.unknown === true;
122889
+ if (this.online === online && !presumed) return;
122867
122890
  const next = {
122868
122891
  online,
122869
- lastChangedAt: Date.now()
122892
+ lastChangedAt: prior !== void 0 && prior.online === online ? prior.lastChangedAt : Date.now()
122870
122893
  };
122871
122894
  this.runtimeState.setCapState("device-status", next);
122872
122895
  }
package/dist/addon.mjs CHANGED
@@ -29159,7 +29159,7 @@ var require_lz4 = /* @__PURE__ */ __commonJSMin(((exports) => {
29159
29159
  };
29160
29160
  }));
29161
29161
  //#endregion
29162
- //#region node_modules/@apocaliss92/nodelink-js/dist/chunk-NFHCFWUF.js
29162
+ //#region node_modules/@apocaliss92/nodelink-js/dist/chunk-7P5XTMMX.js
29163
29163
  var import_fxp = require_fxp();
29164
29164
  var import_lz4 = /* @__PURE__ */ __toESM(require_lz4(), 1);
29165
29165
  function bcHeaderLen(messageClass, buf, bodyLen) {
@@ -29984,6 +29984,9 @@ var BcUdpStream = class extends EventEmitter {
29984
29984
  received = /* @__PURE__ */ new Map();
29985
29985
  sent = /* @__PURE__ */ new Map();
29986
29986
  ackTimer;
29987
+ /** When delivery first became blocked by a missing packet (head-of-line). */
29988
+ holSinceMs;
29989
+ holStallLogged = false;
29987
29990
  resendTimer;
29988
29991
  hbTimer;
29989
29992
  discoveryTid;
@@ -30916,7 +30919,12 @@ var BcUdpStream = class extends EventEmitter {
30916
30919
  lastAckRxAgoMs: this.lastAckRxAtMs !== void 0 ? now - this.lastAckRxAtMs : void 0,
30917
30920
  unackedPackets: this.sent.size,
30918
30921
  ...oldestUnackedAgeMs !== void 0 ? { oldestUnackedAgeMs } : {},
30919
- discFromCamera: this.discFromCameraAtMs !== void 0
30922
+ discFromCamera: this.discFromCameraAtMs !== void 0,
30923
+ ...this.holSinceMs !== void 0 && this.received.size > 0 ? {
30924
+ holBlockedMs: now - this.holSinceMs,
30925
+ holMissingPacketId: this.packetsWant
30926
+ } : {},
30927
+ holBufferedPackets: this.received.size
30920
30928
  };
30921
30929
  }
30922
30930
  /**
@@ -30927,6 +30935,12 @@ var BcUdpStream = class extends EventEmitter {
30927
30935
  checkStalls(now) {
30928
30936
  const age = this.connectedAtMs !== void 0 ? now - this.connectedAtMs : void 0;
30929
30937
  const diag = this.getSessionDiagnostics(now);
30938
+ const holStalled = diag.holBlockedMs !== void 0 && diag.holBlockedMs >= 1500;
30939
+ if (holStalled && !this.holStallLogged) {
30940
+ this.holStallLogged = true;
30941
+ this.discoveryLogger?.warn?.(`[BcUdpStream] head-of-line stall: packet ${diag.holMissingPacketId} missing for ${diag.holBlockedMs}ms, ${diag.holBufferedPackets} later packet(s) withheld, lastDataRxAgoMs=${diag.lastDataRxAgoMs ?? "none"} sessionAgeMs=${age}`);
30942
+ this.emit("debug", "hol_stall", { ...diag });
30943
+ } else if (!holStalled) this.holStallLogged = false;
30930
30944
  const ackStalled = diag.oldestUnackedAgeMs !== void 0 && diag.oldestUnackedAgeMs >= 5e3;
30931
30945
  if (ackStalled && !this.ackWindowStallLogged) {
30932
30946
  this.ackWindowStallLogged = true;
@@ -30971,6 +30985,10 @@ var BcUdpStream = class extends EventEmitter {
30971
30985
  }
30972
30986
  });
30973
30987
  }
30988
+ trackHeadOfLine(now) {
30989
+ if (!(this.received.size > 0 && !this.received.has(this.packetsWant))) this.holSinceMs = void 0;
30990
+ else if (this.holSinceMs === void 0) this.holSinceMs = now;
30991
+ }
30974
30992
  flushReceived() {
30975
30993
  while (this.received.has(this.packetsWant)) {
30976
30994
  const chunk = this.received.get(this.packetsWant);
@@ -31013,6 +31031,7 @@ var BcUdpStream = class extends EventEmitter {
31013
31031
  if (p.packetId >= this.packetsWant) {
31014
31032
  this.received.set(p.packetId, p.payload);
31015
31033
  this.flushReceived();
31034
+ this.trackHeadOfLine(Date.now());
31016
31035
  this.updateAckPacket();
31017
31036
  if (this.packetsWant % 100 === 0) this.emit("debug", "udp_progress", { packetsWant: this.packetsWant });
31018
31037
  }
@@ -122815,7 +122834,8 @@ var BaseDevice = class {
122815
122834
  if (!this.statusIsExternal) {
122816
122835
  const seed = {
122817
122836
  online: true,
122818
- lastChangedAt: Date.now()
122837
+ lastChangedAt: Date.now(),
122838
+ unknown: true
122819
122839
  };
122820
122840
  this.runtimeState.setCapState("device-status", seed);
122821
122841
  }
@@ -122857,10 +122877,13 @@ var BaseDevice = class {
122857
122877
  * override to gate side effects on the transition.
122858
122878
  */
122859
122879
  markOnline(online) {
122860
- if (this.statusIsExternal || this.online === online) return;
122880
+ if (this.statusIsExternal) return;
122881
+ const prior = this.runtimeState.getCapState("device-status");
122882
+ const presumed = prior?.unknown === true;
122883
+ if (this.online === online && !presumed) return;
122861
122884
  const next = {
122862
122885
  online,
122863
- lastChangedAt: Date.now()
122886
+ lastChangedAt: prior !== void 0 && prior.online === online ? prior.lastChangedAt : Date.now()
122864
122887
  };
122865
122888
  this.runtimeState.setCapState("device-status", next);
122866
122889
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-reolink",
3
- "version": "1.2.262",
3
+ "version": "1.2.263",
4
4
  "description": "Reolink camera device provider addon for CamStack — native Baichuan protocol",
5
5
  "keywords": [
6
6
  "camstack",
@@ -96,7 +96,7 @@
96
96
  "werift"
97
97
  ],
98
98
  "requires": {
99
- "server": ">=1.2.952"
99
+ "server": ">=1.2.960"
100
100
  }
101
101
  },
102
102
  "files": [
@@ -114,7 +114,7 @@
114
114
  "publish:npm": "npm publish --access public"
115
115
  },
116
116
  "dependencies": {
117
- "@apocaliss92/nodelink-js": "^0.14.1"
117
+ "@apocaliss92/nodelink-js": "^0.14.2"
118
118
  },
119
119
  "peerDependencies": {
120
120
  "@camstack/types": "*",