@naylence/runtime 0.3.5-test.958 → 0.3.5-test.960

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.
@@ -1,33 +1,23 @@
1
- // import { getLogger } from './logging.js';
2
- // const logger = getLogger('naylence.fame.util.lock');
3
1
  export class AsyncLock {
4
2
  constructor() {
5
- this.queue = Promise.resolve();
3
+ this.tail = Promise.resolve();
6
4
  }
7
- async acquire(task) {
8
- const currentQueue = this.queue;
5
+ async runExclusive(operation) {
9
6
  let release;
10
- const nextPromise = new Promise((resolve) => {
7
+ const next = new Promise((resolve) => {
11
8
  release = resolve;
12
9
  });
13
- // Chain the new promise to the queue
14
- this.queue = this.queue.then(() => nextPromise, () => nextPromise);
15
- // Wait for the previous task to complete
16
- // logger.debug('waiting_for_lock');
17
- await currentQueue;
18
- // logger.debug('lock_acquired');
10
+ const previous = this.tail;
11
+ this.tail = previous.then(() => next, () => next);
12
+ await previous;
19
13
  try {
20
- return await task();
14
+ return await operation();
21
15
  }
22
16
  finally {
23
17
  release();
24
- // logger.debug('lock_released');
25
18
  }
26
19
  }
27
- async runExclusive(task) {
28
- return this.acquire(task);
29
- }
30
20
  }
31
21
  export async function withLock(lock, operation) {
32
- return await lock.acquire(operation);
22
+ return await lock.runExclusive(operation);
33
23
  }
@@ -1,7 +1,7 @@
1
1
  // This file is auto-generated during build - do not edit manually
2
- // Generated from package.json version: 0.3.5-test.958
2
+ // Generated from package.json version: 0.3.5-test.960
3
3
  /**
4
4
  * The package version, injected at build time.
5
5
  * @internal
6
6
  */
7
- export const VERSION = '0.3.5-test.958';
7
+ export const VERSION = '0.3.5-test.960';
@@ -14,12 +14,12 @@ var fastify = require('fastify');
14
14
  var websocketPlugin = require('@fastify/websocket');
15
15
 
16
16
  // This file is auto-generated during build - do not edit manually
17
- // Generated from package.json version: 0.3.5-test.958
17
+ // Generated from package.json version: 0.3.5-test.960
18
18
  /**
19
19
  * The package version, injected at build time.
20
20
  * @internal
21
21
  */
22
- const VERSION = '0.3.5-test.958';
22
+ const VERSION = '0.3.5-test.960';
23
23
 
24
24
  /**
25
25
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -1274,38 +1274,28 @@ class TaskSpawner {
1274
1274
  }
1275
1275
  }
1276
1276
 
1277
- // import { getLogger } from './logging.js';
1278
- // const logger = getLogger('naylence.fame.util.lock');
1279
1277
  class AsyncLock {
1280
1278
  constructor() {
1281
- this.queue = Promise.resolve();
1279
+ this.tail = Promise.resolve();
1282
1280
  }
1283
- async acquire(task) {
1284
- const currentQueue = this.queue;
1281
+ async runExclusive(operation) {
1285
1282
  let release;
1286
- const nextPromise = new Promise((resolve) => {
1283
+ const next = new Promise((resolve) => {
1287
1284
  release = resolve;
1288
1285
  });
1289
- // Chain the new promise to the queue
1290
- this.queue = this.queue.then(() => nextPromise, () => nextPromise);
1291
- // Wait for the previous task to complete
1292
- // logger.debug('waiting_for_lock');
1293
- await currentQueue;
1294
- // logger.debug('lock_acquired');
1286
+ const previous = this.tail;
1287
+ this.tail = previous.then(() => next, () => next);
1288
+ await previous;
1295
1289
  try {
1296
- return await task();
1290
+ return await operation();
1297
1291
  }
1298
1292
  finally {
1299
1293
  release();
1300
- // logger.debug('lock_released');
1301
1294
  }
1302
1295
  }
1303
- async runExclusive(task) {
1304
- return this.acquire(task);
1305
- }
1306
1296
  }
1307
1297
  async function withLock(lock, operation) {
1308
- return await lock.acquire(operation);
1298
+ return await lock.runExclusive(operation);
1309
1299
  }
1310
1300
 
1311
1301
  /**
@@ -9602,11 +9592,31 @@ class BaseAsyncConnector extends TaskSpawner {
9602
9592
  * Emit credit update if flow control needs refill
9603
9593
  */
9604
9594
  async _maybeEmitCredit(flowId, traceId) {
9605
- if (!this._flowCtrl.needsRefill(flowId)) {
9595
+ const remainingCredits = this._flowCtrl.getCredits(flowId);
9596
+ const needsRefill = this._flowCtrl.needsRefill(flowId);
9597
+ logger$$.debug('maybe_emit_credit_check', {
9598
+ connector_id: this._connectorFlowId,
9599
+ flow_id: flowId,
9600
+ trace_id: traceId ?? null,
9601
+ remaining_credits: remainingCredits,
9602
+ low_watermark: this._flowCtrl instanceof FlowController
9603
+ ? this._flowCtrl.lowWatermark
9604
+ : null,
9605
+ initial_window: this._initialWindow,
9606
+ needs_refill: needsRefill,
9607
+ });
9608
+ if (!needsRefill) {
9606
9609
  return;
9607
9610
  }
9608
9611
  const delta = this._initialWindow;
9609
9612
  this._flowCtrl.addCredits(flowId, delta);
9613
+ logger$$.debug('maybe_emit_credit_emit', {
9614
+ connector_id: this._connectorFlowId,
9615
+ flow_id: flowId,
9616
+ trace_id: traceId ?? null,
9617
+ emitted_credits: delta,
9618
+ post_emit_balance: this._flowCtrl.getCredits(flowId),
9619
+ });
9610
9620
  const ackEnv = core.createFameEnvelope({
9611
9621
  ...(traceId && { traceId }),
9612
9622
  flowId,
@@ -9618,7 +9628,25 @@ class BaseAsyncConnector extends TaskSpawner {
9618
9628
  },
9619
9629
  flags: core.FlowFlags.ACK,
9620
9630
  });
9621
- await this.send(ackEnv);
9631
+ try {
9632
+ await this.send(ackEnv);
9633
+ logger$$.debug('maybe_emit_credit_sent', {
9634
+ connector_id: this._connectorFlowId,
9635
+ flow_id: flowId,
9636
+ trace_id: traceId ?? null,
9637
+ credits_acknowledged: delta,
9638
+ });
9639
+ }
9640
+ catch (error) {
9641
+ logger$$.error('maybe_emit_credit_send_failed', {
9642
+ connector_id: this._connectorFlowId,
9643
+ flow_id: flowId,
9644
+ trace_id: traceId ?? null,
9645
+ credits_attempted: delta,
9646
+ error: error instanceof Error ? error.message : String(error),
9647
+ });
9648
+ throw error;
9649
+ }
9622
9650
  }
9623
9651
  // ---------------------------------------------------------------------
9624
9652
  // Shutdown Management
@@ -10149,6 +10177,14 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10149
10177
  const normalizedSenderId = typeof senderId === 'string' && senderId.length > 0
10150
10178
  ? senderId
10151
10179
  : undefined;
10180
+ logger$_.debug('broadcast_channel_duplicate_ack_check', {
10181
+ channel: this.channelName,
10182
+ connector_id: this.connectorId,
10183
+ sender_id: normalizedSenderId ?? null,
10184
+ dedup_key: dedupKey,
10185
+ source: 'listener',
10186
+ cache_entries: this.seenAckKeys.size,
10187
+ });
10152
10188
  return this._checkDuplicateAck(dedupKey, normalizedSenderId);
10153
10189
  }
10154
10190
  _shouldSkipDuplicateAckFromInboxItem(item) {
@@ -10171,6 +10207,14 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10171
10207
  return false;
10172
10208
  }
10173
10209
  const senderId = this._extractSenderIdFromInboxItem(item);
10210
+ logger$_.debug('broadcast_channel_duplicate_ack_check', {
10211
+ channel: this.channelName,
10212
+ connector_id: this.connectorId,
10213
+ sender_id: senderId ?? null,
10214
+ dedup_key: dedupKey,
10215
+ source: 'inbox_item',
10216
+ cache_entries: this.seenAckKeys.size,
10217
+ });
10174
10218
  return this._checkDuplicateAck(dedupKey, senderId);
10175
10219
  }
10176
10220
  _checkDuplicateAck(dedupKey, senderId) {
@@ -10182,11 +10226,21 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10182
10226
  connector_id: this.connectorId,
10183
10227
  sender_id: senderId ?? null,
10184
10228
  dedup_key: dedupKey,
10229
+ age_ms: now - lastSeen,
10230
+ ttl_ms: this.ackDedupTtlMs,
10231
+ cache_entries: this.seenAckKeys.size,
10185
10232
  });
10186
10233
  return true;
10187
10234
  }
10188
10235
  this.seenAckKeys.set(dedupKey, now);
10189
10236
  this.seenAckOrder.push(dedupKey);
10237
+ logger$_.debug('broadcast_channel_duplicate_ack_recorded', {
10238
+ channel: this.channelName,
10239
+ connector_id: this.connectorId,
10240
+ sender_id: senderId ?? null,
10241
+ dedup_key: dedupKey,
10242
+ cache_entries: this.seenAckKeys.size,
10243
+ });
10190
10244
  this._trimSeenAcks(now);
10191
10245
  return false;
10192
10246
  }
@@ -19897,9 +19951,6 @@ class WebSocketConnector extends BaseAsyncConnector {
19897
19951
  // Browser WebSocket or Node.js ws client
19898
19952
  this._websocket.send(data);
19899
19953
  }
19900
- logger$H.debug('websocket_sent_bytes', {
19901
- byte_length: data.length,
19902
- });
19903
19954
  }
19904
19955
  catch (error) {
19905
19956
  // Handle WebSocket disconnection errors
@@ -13,12 +13,12 @@ import fastify from 'fastify';
13
13
  import websocketPlugin from '@fastify/websocket';
14
14
 
15
15
  // This file is auto-generated during build - do not edit manually
16
- // Generated from package.json version: 0.3.5-test.958
16
+ // Generated from package.json version: 0.3.5-test.960
17
17
  /**
18
18
  * The package version, injected at build time.
19
19
  * @internal
20
20
  */
21
- const VERSION = '0.3.5-test.958';
21
+ const VERSION = '0.3.5-test.960';
22
22
 
23
23
  /**
24
24
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -1273,38 +1273,28 @@ class TaskSpawner {
1273
1273
  }
1274
1274
  }
1275
1275
 
1276
- // import { getLogger } from './logging.js';
1277
- // const logger = getLogger('naylence.fame.util.lock');
1278
1276
  class AsyncLock {
1279
1277
  constructor() {
1280
- this.queue = Promise.resolve();
1278
+ this.tail = Promise.resolve();
1281
1279
  }
1282
- async acquire(task) {
1283
- const currentQueue = this.queue;
1280
+ async runExclusive(operation) {
1284
1281
  let release;
1285
- const nextPromise = new Promise((resolve) => {
1282
+ const next = new Promise((resolve) => {
1286
1283
  release = resolve;
1287
1284
  });
1288
- // Chain the new promise to the queue
1289
- this.queue = this.queue.then(() => nextPromise, () => nextPromise);
1290
- // Wait for the previous task to complete
1291
- // logger.debug('waiting_for_lock');
1292
- await currentQueue;
1293
- // logger.debug('lock_acquired');
1285
+ const previous = this.tail;
1286
+ this.tail = previous.then(() => next, () => next);
1287
+ await previous;
1294
1288
  try {
1295
- return await task();
1289
+ return await operation();
1296
1290
  }
1297
1291
  finally {
1298
1292
  release();
1299
- // logger.debug('lock_released');
1300
1293
  }
1301
1294
  }
1302
- async runExclusive(task) {
1303
- return this.acquire(task);
1304
- }
1305
1295
  }
1306
1296
  async function withLock(lock, operation) {
1307
- return await lock.acquire(operation);
1297
+ return await lock.runExclusive(operation);
1308
1298
  }
1309
1299
 
1310
1300
  /**
@@ -9601,11 +9591,31 @@ class BaseAsyncConnector extends TaskSpawner {
9601
9591
  * Emit credit update if flow control needs refill
9602
9592
  */
9603
9593
  async _maybeEmitCredit(flowId, traceId) {
9604
- if (!this._flowCtrl.needsRefill(flowId)) {
9594
+ const remainingCredits = this._flowCtrl.getCredits(flowId);
9595
+ const needsRefill = this._flowCtrl.needsRefill(flowId);
9596
+ logger$$.debug('maybe_emit_credit_check', {
9597
+ connector_id: this._connectorFlowId,
9598
+ flow_id: flowId,
9599
+ trace_id: traceId ?? null,
9600
+ remaining_credits: remainingCredits,
9601
+ low_watermark: this._flowCtrl instanceof FlowController
9602
+ ? this._flowCtrl.lowWatermark
9603
+ : null,
9604
+ initial_window: this._initialWindow,
9605
+ needs_refill: needsRefill,
9606
+ });
9607
+ if (!needsRefill) {
9605
9608
  return;
9606
9609
  }
9607
9610
  const delta = this._initialWindow;
9608
9611
  this._flowCtrl.addCredits(flowId, delta);
9612
+ logger$$.debug('maybe_emit_credit_emit', {
9613
+ connector_id: this._connectorFlowId,
9614
+ flow_id: flowId,
9615
+ trace_id: traceId ?? null,
9616
+ emitted_credits: delta,
9617
+ post_emit_balance: this._flowCtrl.getCredits(flowId),
9618
+ });
9609
9619
  const ackEnv = createFameEnvelope({
9610
9620
  ...(traceId && { traceId }),
9611
9621
  flowId,
@@ -9617,7 +9627,25 @@ class BaseAsyncConnector extends TaskSpawner {
9617
9627
  },
9618
9628
  flags: FlowFlags.ACK,
9619
9629
  });
9620
- await this.send(ackEnv);
9630
+ try {
9631
+ await this.send(ackEnv);
9632
+ logger$$.debug('maybe_emit_credit_sent', {
9633
+ connector_id: this._connectorFlowId,
9634
+ flow_id: flowId,
9635
+ trace_id: traceId ?? null,
9636
+ credits_acknowledged: delta,
9637
+ });
9638
+ }
9639
+ catch (error) {
9640
+ logger$$.error('maybe_emit_credit_send_failed', {
9641
+ connector_id: this._connectorFlowId,
9642
+ flow_id: flowId,
9643
+ trace_id: traceId ?? null,
9644
+ credits_attempted: delta,
9645
+ error: error instanceof Error ? error.message : String(error),
9646
+ });
9647
+ throw error;
9648
+ }
9621
9649
  }
9622
9650
  // ---------------------------------------------------------------------
9623
9651
  // Shutdown Management
@@ -10148,6 +10176,14 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10148
10176
  const normalizedSenderId = typeof senderId === 'string' && senderId.length > 0
10149
10177
  ? senderId
10150
10178
  : undefined;
10179
+ logger$_.debug('broadcast_channel_duplicate_ack_check', {
10180
+ channel: this.channelName,
10181
+ connector_id: this.connectorId,
10182
+ sender_id: normalizedSenderId ?? null,
10183
+ dedup_key: dedupKey,
10184
+ source: 'listener',
10185
+ cache_entries: this.seenAckKeys.size,
10186
+ });
10151
10187
  return this._checkDuplicateAck(dedupKey, normalizedSenderId);
10152
10188
  }
10153
10189
  _shouldSkipDuplicateAckFromInboxItem(item) {
@@ -10170,6 +10206,14 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10170
10206
  return false;
10171
10207
  }
10172
10208
  const senderId = this._extractSenderIdFromInboxItem(item);
10209
+ logger$_.debug('broadcast_channel_duplicate_ack_check', {
10210
+ channel: this.channelName,
10211
+ connector_id: this.connectorId,
10212
+ sender_id: senderId ?? null,
10213
+ dedup_key: dedupKey,
10214
+ source: 'inbox_item',
10215
+ cache_entries: this.seenAckKeys.size,
10216
+ });
10173
10217
  return this._checkDuplicateAck(dedupKey, senderId);
10174
10218
  }
10175
10219
  _checkDuplicateAck(dedupKey, senderId) {
@@ -10181,11 +10225,21 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10181
10225
  connector_id: this.connectorId,
10182
10226
  sender_id: senderId ?? null,
10183
10227
  dedup_key: dedupKey,
10228
+ age_ms: now - lastSeen,
10229
+ ttl_ms: this.ackDedupTtlMs,
10230
+ cache_entries: this.seenAckKeys.size,
10184
10231
  });
10185
10232
  return true;
10186
10233
  }
10187
10234
  this.seenAckKeys.set(dedupKey, now);
10188
10235
  this.seenAckOrder.push(dedupKey);
10236
+ logger$_.debug('broadcast_channel_duplicate_ack_recorded', {
10237
+ channel: this.channelName,
10238
+ connector_id: this.connectorId,
10239
+ sender_id: senderId ?? null,
10240
+ dedup_key: dedupKey,
10241
+ cache_entries: this.seenAckKeys.size,
10242
+ });
10189
10243
  this._trimSeenAcks(now);
10190
10244
  return false;
10191
10245
  }
@@ -19896,9 +19950,6 @@ class WebSocketConnector extends BaseAsyncConnector {
19896
19950
  // Browser WebSocket or Node.js ws client
19897
19951
  this._websocket.send(data);
19898
19952
  }
19899
- logger$H.debug('websocket_sent_bytes', {
19900
- byte_length: data.length,
19901
- });
19902
19953
  }
19903
19954
  catch (error) {
19904
19955
  // Handle WebSocket disconnection errors
@@ -2522,11 +2522,31 @@ class BaseAsyncConnector extends TaskSpawner {
2522
2522
  * Emit credit update if flow control needs refill
2523
2523
  */
2524
2524
  async _maybeEmitCredit(flowId, traceId) {
2525
- if (!this._flowCtrl.needsRefill(flowId)) {
2525
+ const remainingCredits = this._flowCtrl.getCredits(flowId);
2526
+ const needsRefill = this._flowCtrl.needsRefill(flowId);
2527
+ logger$1f.debug('maybe_emit_credit_check', {
2528
+ connector_id: this._connectorFlowId,
2529
+ flow_id: flowId,
2530
+ trace_id: traceId ?? null,
2531
+ remaining_credits: remainingCredits,
2532
+ low_watermark: this._flowCtrl instanceof FlowController
2533
+ ? this._flowCtrl.lowWatermark
2534
+ : null,
2535
+ initial_window: this._initialWindow,
2536
+ needs_refill: needsRefill,
2537
+ });
2538
+ if (!needsRefill) {
2526
2539
  return;
2527
2540
  }
2528
2541
  const delta = this._initialWindow;
2529
2542
  this._flowCtrl.addCredits(flowId, delta);
2543
+ logger$1f.debug('maybe_emit_credit_emit', {
2544
+ connector_id: this._connectorFlowId,
2545
+ flow_id: flowId,
2546
+ trace_id: traceId ?? null,
2547
+ emitted_credits: delta,
2548
+ post_emit_balance: this._flowCtrl.getCredits(flowId),
2549
+ });
2530
2550
  const ackEnv = core.createFameEnvelope({
2531
2551
  ...(traceId && { traceId }),
2532
2552
  flowId,
@@ -2538,7 +2558,25 @@ class BaseAsyncConnector extends TaskSpawner {
2538
2558
  },
2539
2559
  flags: core.FlowFlags.ACK,
2540
2560
  });
2541
- await this.send(ackEnv);
2561
+ try {
2562
+ await this.send(ackEnv);
2563
+ logger$1f.debug('maybe_emit_credit_sent', {
2564
+ connector_id: this._connectorFlowId,
2565
+ flow_id: flowId,
2566
+ trace_id: traceId ?? null,
2567
+ credits_acknowledged: delta,
2568
+ });
2569
+ }
2570
+ catch (error) {
2571
+ logger$1f.error('maybe_emit_credit_send_failed', {
2572
+ connector_id: this._connectorFlowId,
2573
+ flow_id: flowId,
2574
+ trace_id: traceId ?? null,
2575
+ credits_attempted: delta,
2576
+ error: error instanceof Error ? error.message : String(error),
2577
+ });
2578
+ throw error;
2579
+ }
2542
2580
  }
2543
2581
  // ---------------------------------------------------------------------
2544
2582
  // Shutdown Management
@@ -2789,9 +2827,6 @@ class WebSocketConnector extends BaseAsyncConnector {
2789
2827
  // Browser WebSocket or Node.js ws client
2790
2828
  this._websocket.send(data);
2791
2829
  }
2792
- logger$1e.debug('websocket_sent_bytes', {
2793
- byte_length: data.length,
2794
- });
2795
2830
  }
2796
2831
  catch (error) {
2797
2832
  // Handle WebSocket disconnection errors
@@ -5120,38 +5155,28 @@ class EncryptedStorageProviderBase {
5120
5155
  }
5121
5156
  }
5122
5157
 
5123
- // import { getLogger } from './logging.js';
5124
- // const logger = getLogger('naylence.fame.util.lock');
5125
5158
  class AsyncLock {
5126
5159
  constructor() {
5127
- this.queue = Promise.resolve();
5160
+ this.tail = Promise.resolve();
5128
5161
  }
5129
- async acquire(task) {
5130
- const currentQueue = this.queue;
5162
+ async runExclusive(operation) {
5131
5163
  let release;
5132
- const nextPromise = new Promise((resolve) => {
5164
+ const next = new Promise((resolve) => {
5133
5165
  release = resolve;
5134
5166
  });
5135
- // Chain the new promise to the queue
5136
- this.queue = this.queue.then(() => nextPromise, () => nextPromise);
5137
- // Wait for the previous task to complete
5138
- // logger.debug('waiting_for_lock');
5139
- await currentQueue;
5140
- // logger.debug('lock_acquired');
5167
+ const previous = this.tail;
5168
+ this.tail = previous.then(() => next, () => next);
5169
+ await previous;
5141
5170
  try {
5142
- return await task();
5171
+ return await operation();
5143
5172
  }
5144
5173
  finally {
5145
5174
  release();
5146
- // logger.debug('lock_released');
5147
5175
  }
5148
5176
  }
5149
- async runExclusive(task) {
5150
- return this.acquire(task);
5151
- }
5152
5177
  }
5153
5178
  async function withLock(lock, operation) {
5154
- return await lock.acquire(operation);
5179
+ return await lock.runExclusive(operation);
5155
5180
  }
5156
5181
 
5157
5182
  const logger$1b = getLogger('naylence.fame.storage.sqlite_storage_provider');
@@ -5538,12 +5563,12 @@ for (const [name, config] of Object.entries(SQLITE_PROFILES)) {
5538
5563
  }
5539
5564
 
5540
5565
  // This file is auto-generated during build - do not edit manually
5541
- // Generated from package.json version: 0.3.5-test.958
5566
+ // Generated from package.json version: 0.3.5-test.960
5542
5567
  /**
5543
5568
  * The package version, injected at build time.
5544
5569
  * @internal
5545
5570
  */
5546
- const VERSION = '0.3.5-test.958';
5571
+ const VERSION = '0.3.5-test.960';
5547
5572
 
5548
5573
  /**
5549
5574
  * Fame errors module - Fame protocol specific error classes
@@ -11889,6 +11914,14 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11889
11914
  const normalizedSenderId = typeof senderId === 'string' && senderId.length > 0
11890
11915
  ? senderId
11891
11916
  : undefined;
11917
+ logger$10.debug('broadcast_channel_duplicate_ack_check', {
11918
+ channel: this.channelName,
11919
+ connector_id: this.connectorId,
11920
+ sender_id: normalizedSenderId ?? null,
11921
+ dedup_key: dedupKey,
11922
+ source: 'listener',
11923
+ cache_entries: this.seenAckKeys.size,
11924
+ });
11892
11925
  return this._checkDuplicateAck(dedupKey, normalizedSenderId);
11893
11926
  }
11894
11927
  _shouldSkipDuplicateAckFromInboxItem(item) {
@@ -11911,6 +11944,14 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11911
11944
  return false;
11912
11945
  }
11913
11946
  const senderId = this._extractSenderIdFromInboxItem(item);
11947
+ logger$10.debug('broadcast_channel_duplicate_ack_check', {
11948
+ channel: this.channelName,
11949
+ connector_id: this.connectorId,
11950
+ sender_id: senderId ?? null,
11951
+ dedup_key: dedupKey,
11952
+ source: 'inbox_item',
11953
+ cache_entries: this.seenAckKeys.size,
11954
+ });
11914
11955
  return this._checkDuplicateAck(dedupKey, senderId);
11915
11956
  }
11916
11957
  _checkDuplicateAck(dedupKey, senderId) {
@@ -11922,11 +11963,21 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11922
11963
  connector_id: this.connectorId,
11923
11964
  sender_id: senderId ?? null,
11924
11965
  dedup_key: dedupKey,
11966
+ age_ms: now - lastSeen,
11967
+ ttl_ms: this.ackDedupTtlMs,
11968
+ cache_entries: this.seenAckKeys.size,
11925
11969
  });
11926
11970
  return true;
11927
11971
  }
11928
11972
  this.seenAckKeys.set(dedupKey, now);
11929
11973
  this.seenAckOrder.push(dedupKey);
11974
+ logger$10.debug('broadcast_channel_duplicate_ack_recorded', {
11975
+ channel: this.channelName,
11976
+ connector_id: this.connectorId,
11977
+ sender_id: senderId ?? null,
11978
+ dedup_key: dedupKey,
11979
+ cache_entries: this.seenAckKeys.size,
11980
+ });
11930
11981
  this._trimSeenAcks(now);
11931
11982
  return false;
11932
11983
  }