@naylence/agent-sdk 0.3.5-test.102 → 0.3.5-test.103

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.
@@ -15674,12 +15674,12 @@
15674
15674
  // --- END ENV SHIM ---
15675
15675
 
15676
15676
  // This file is auto-generated during build - do not edit manually
15677
- // Generated from package.json version: 0.3.6-test.107
15677
+ // Generated from package.json version: 0.3.6-test.108
15678
15678
  /**
15679
15679
  * The package version, injected at build time.
15680
15680
  * @internal
15681
15681
  */
15682
- const VERSION$1 = '0.3.6-test.107';
15682
+ const VERSION$1 = '0.3.6-test.108';
15683
15683
 
15684
15684
  /**
15685
15685
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -21831,9 +21831,6 @@
21831
21831
  this.ackDoneSince = new Map();
21832
21832
  this.replyDoneSince = new Map();
21833
21833
  this.pendingAckDispatches = new Set();
21834
- this.recentlyHandled = new Map();
21835
- this.recentlyHandledOrder = [];
21836
- this.recentlyHandledTtlMs = 60000;
21837
21834
  this.isPreparingToStop = false;
21838
21835
  this.shutdownRequestedAtMs = null;
21839
21836
  this.shutdownRetryGraceMs = 1000;
@@ -22055,22 +22052,6 @@
22055
22052
  }
22056
22053
  }
22057
22054
  else {
22058
- const wasRecentlyHandled = await this.lock.runExclusive(async () => this.wasRecentlyHandled(envelope.id));
22059
- if (wasRecentlyHandled) {
22060
- logger$12.debug('tracker_duplicate_envelope_recently_handled', {
22061
- envp_id: envelope.id,
22062
- });
22063
- return new TrackedEnvelope({
22064
- timeoutAtMs: 0,
22065
- overallTimeoutAtMs: 0,
22066
- expectedResponseType: envelope.rtype ?? FameResponseType.NONE,
22067
- createdAtMs: Date.now(),
22068
- status: EnvelopeStatus.HANDLED,
22069
- mailboxType: MailboxType.INBOX,
22070
- originalEnvelope: envelope,
22071
- serviceName: inboxName,
22072
- });
22073
- }
22074
22055
  tracked = new TrackedEnvelope({
22075
22056
  timeoutAtMs: 0,
22076
22057
  overallTimeoutAtMs: 0,
@@ -22092,12 +22073,8 @@
22092
22073
  async onEnvelopeHandled(envelope) {
22093
22074
  const inbox = this.ensureInbox();
22094
22075
  envelope.status = EnvelopeStatus.HANDLED;
22076
+ // Delete the envelope from inbox to prevent growth
22095
22077
  await inbox.delete(envelope.originalEnvelope.id);
22096
- await this.lock.runExclusive(async () => {
22097
- this.markRecentlyHandled(envelope.originalEnvelope.id);
22098
- });
22099
- // Preserve handled envelope to prevent duplicate redelivery during shutdown drains.
22100
- // await inbox.set(envelope.originalEnvelope.id, envelope);
22101
22078
  }
22102
22079
  async onEnvelopeHandleFailed(inboxName, envelope, context, error, isFinalFailure = false) {
22103
22080
  const inbox = this.ensureInbox();
@@ -22464,8 +22441,6 @@
22464
22441
  }
22465
22442
  this.streamDone.clear();
22466
22443
  this.correlationToEnvelope.clear();
22467
- this.recentlyHandled.clear();
22468
- this.recentlyHandledOrder.length = 0;
22469
22444
  return values;
22470
22445
  });
22471
22446
  for (const timer of timers) {
@@ -23047,39 +23022,6 @@
23047
23022
  this.pendingAckDispatches.delete(ackDispatch);
23048
23023
  }
23049
23024
  }
23050
- markRecentlyHandled(envelopeId) {
23051
- const now = Date.now();
23052
- this.recentlyHandled.set(envelopeId, now);
23053
- this.recentlyHandledOrder.push(envelopeId);
23054
- this.trimRecentlyHandled(now);
23055
- }
23056
- wasRecentlyHandled(envelopeId) {
23057
- const now = Date.now();
23058
- const timestamp = this.recentlyHandled.get(envelopeId);
23059
- if (timestamp === undefined) {
23060
- return false;
23061
- }
23062
- if (now - timestamp > this.recentlyHandledTtlMs) {
23063
- this.recentlyHandled.delete(envelopeId);
23064
- return false;
23065
- }
23066
- return true;
23067
- }
23068
- trimRecentlyHandled(now) {
23069
- while (this.recentlyHandledOrder.length > 0) {
23070
- const candidate = this.recentlyHandledOrder[0];
23071
- const timestamp = this.recentlyHandled.get(candidate);
23072
- if (timestamp === undefined) {
23073
- this.recentlyHandledOrder.shift();
23074
- continue;
23075
- }
23076
- if (now - timestamp <= this.recentlyHandledTtlMs) {
23077
- break;
23078
- }
23079
- this.recentlyHandled.delete(candidate);
23080
- this.recentlyHandledOrder.shift();
23081
- }
23082
- }
23083
23025
  getShutdownRetryDeferDelay(nowMs) {
23084
23026
  if (!this.isPreparingToStop || this.shutdownRequestedAtMs === null) {
23085
23027
  return null;