@naylence/runtime 0.3.6-test.103 → 0.3.6-test.107
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/dist/browser/index.cjs +43 -6
- package/dist/browser/index.mjs +43 -6
- package/dist/cjs/naylence/fame/connector/broadcast-channel-connector-factory.js +4 -0
- package/dist/cjs/naylence/fame/connector/broadcast-channel-connector.browser.js +1 -0
- package/dist/cjs/naylence/fame/connector/broadcast-channel-listener.js +9 -1
- package/dist/cjs/naylence/fame/delivery/default-delivery-tracker.js +3 -3
- package/dist/cjs/naylence/fame/node/upstream-session-manager.js +24 -0
- package/dist/cjs/version.js +2 -2
- package/dist/esm/naylence/fame/connector/broadcast-channel-connector-factory.js +4 -0
- package/dist/esm/naylence/fame/connector/broadcast-channel-connector.browser.js +1 -0
- package/dist/esm/naylence/fame/connector/broadcast-channel-listener.js +9 -1
- package/dist/esm/naylence/fame/delivery/default-delivery-tracker.js +3 -3
- package/dist/esm/naylence/fame/node/upstream-session-manager.js +24 -0
- package/dist/esm/version.js +2 -2
- package/dist/node/index.cjs +43 -6
- package/dist/node/index.mjs +43 -6
- package/dist/node/node.cjs +43 -6
- package/dist/node/node.mjs +43 -6
- package/dist/types/naylence/fame/connector/broadcast-channel-connector-factory.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/browser/index.cjs
CHANGED
|
@@ -98,12 +98,12 @@ installProcessEnvShim();
|
|
|
98
98
|
// --- END ENV SHIM ---
|
|
99
99
|
|
|
100
100
|
// This file is auto-generated during build - do not edit manually
|
|
101
|
-
// Generated from package.json version: 0.3.6-test.
|
|
101
|
+
// Generated from package.json version: 0.3.6-test.107
|
|
102
102
|
/**
|
|
103
103
|
* The package version, injected at build time.
|
|
104
104
|
* @internal
|
|
105
105
|
*/
|
|
106
|
-
const VERSION = '0.3.6-test.
|
|
106
|
+
const VERSION = '0.3.6-test.107';
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
109
|
* Fame protocol specific error classes with WebSocket close codes and proper inheritance.
|
|
@@ -7656,9 +7656,9 @@ class DefaultDeliveryTracker extends TaskSpawner {
|
|
|
7656
7656
|
});
|
|
7657
7657
|
await this.markDoneSince(this.replyFutures, trackedEnvelope.originalEnvelope.id, this.replyDoneSince);
|
|
7658
7658
|
await this.markDoneSince(this.ackFutures, trackedEnvelope.originalEnvelope.id, this.ackDoneSince);
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7659
|
+
// Note: ACK is already sent in onCorrelatedMessage (lines 655-657)
|
|
7660
|
+
// when the reply envelope is first delivered. No need to send it again here.
|
|
7661
|
+
// Removing this duplicate sendAck call fixes the duplicate DeliveryAck bug.
|
|
7662
7662
|
for (const handler of this.eventHandlers) {
|
|
7663
7663
|
await handler.onEnvelopeReplied?.(trackedEnvelope, envelope);
|
|
7664
7664
|
}
|
|
@@ -9996,6 +9996,7 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
9996
9996
|
local_node_id: this.localNodeId,
|
|
9997
9997
|
target_node_id: this.targetNodeId ?? null,
|
|
9998
9998
|
inbox_capacity: preferredCapacity,
|
|
9999
|
+
passive: config.passive ?? false,
|
|
9999
10000
|
timestamp: new Date().toISOString(),
|
|
10000
10001
|
});
|
|
10001
10002
|
this.onMsg = (event) => {
|
|
@@ -10863,12 +10864,20 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10863
10864
|
await connector.start(this.wrappedHandler);
|
|
10864
10865
|
this.connector = connector;
|
|
10865
10866
|
const callbackGrants = this.node.gatherSupportedCallbackGrants();
|
|
10867
|
+
logger$Z.debug('callback_grants_before_augmentation', {
|
|
10868
|
+
count: callbackGrants.length,
|
|
10869
|
+
types: callbackGrants.map(g => g.type),
|
|
10870
|
+
});
|
|
10866
10871
|
// Check if we should create a broadcast callback grant before processing connection grants
|
|
10867
10872
|
// This prevents adding duplicate broadcast grants
|
|
10868
10873
|
const shouldAddBroadcastGrant = this.shouldAdvertiseBroadcastGrant(grant, callbackGrants);
|
|
10869
10874
|
const broadcastCallbackGrant = shouldAddBroadcastGrant
|
|
10870
10875
|
? this.createBroadcastCallbackGrant(grant)
|
|
10871
10876
|
: null;
|
|
10877
|
+
logger$Z.debug('broadcast_callback_grant_check', {
|
|
10878
|
+
should_add: shouldAddBroadcastGrant,
|
|
10879
|
+
grant_created: !!broadcastCallbackGrant,
|
|
10880
|
+
});
|
|
10872
10881
|
// Include admission client's connection grants as callback grants
|
|
10873
10882
|
// This ensures DirectAdmissionClient grants are available for grant selection
|
|
10874
10883
|
if (welcome.frame.connectionGrants && Array.isArray(welcome.frame.connectionGrants)) {
|
|
@@ -10878,6 +10887,14 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10878
10887
|
const isDuplicate = callbackGrants.some(existing => JSON.stringify(existing) === JSON.stringify(grant));
|
|
10879
10888
|
if (!isDuplicate) {
|
|
10880
10889
|
callbackGrants.push(grant);
|
|
10890
|
+
logger$Z.debug('added_connection_grant_as_callback', {
|
|
10891
|
+
type: grant.type,
|
|
10892
|
+
});
|
|
10893
|
+
}
|
|
10894
|
+
else {
|
|
10895
|
+
logger$Z.debug('skipped_duplicate_connection_grant', {
|
|
10896
|
+
type: grant.type,
|
|
10897
|
+
});
|
|
10881
10898
|
}
|
|
10882
10899
|
}
|
|
10883
10900
|
}
|
|
@@ -10886,7 +10903,15 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10886
10903
|
// any broadcast grants that may have been in connectionGrants
|
|
10887
10904
|
if (broadcastCallbackGrant && this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
|
|
10888
10905
|
callbackGrants.push(broadcastCallbackGrant);
|
|
10906
|
+
logger$Z.debug('added_broadcast_callback_grant');
|
|
10907
|
+
}
|
|
10908
|
+
else if (broadcastCallbackGrant) {
|
|
10909
|
+
logger$Z.debug('skipped_duplicate_broadcast_callback_grant');
|
|
10889
10910
|
}
|
|
10911
|
+
logger$Z.debug('callback_grants_after_augmentation', {
|
|
10912
|
+
count: callbackGrants.length,
|
|
10913
|
+
types: callbackGrants.map(g => g.type),
|
|
10914
|
+
});
|
|
10890
10915
|
const attachInfo = await this.attachClient.attach(this.node, this.outboundOriginType, connector, welcome.frame, this.wrappedHandler, this.getKeys() ?? undefined, callbackGrants);
|
|
10891
10916
|
this.targetSystemId = attachInfo.targetSystemId ?? null;
|
|
10892
10917
|
if (this.targetSystemId) {
|
|
@@ -29205,6 +29230,7 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
29205
29230
|
inboxCapacity,
|
|
29206
29231
|
localNodeId,
|
|
29207
29232
|
initialTargetNodeId: resolvedTarget,
|
|
29233
|
+
passive: normalized.passive,
|
|
29208
29234
|
};
|
|
29209
29235
|
const connector = new BroadcastChannelConnector(connectorConfig, baseConfig);
|
|
29210
29236
|
if (options.authorization) {
|
|
@@ -29243,6 +29269,9 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
29243
29269
|
if (normalizedLocalNodeId) {
|
|
29244
29270
|
normalized.localNodeId = normalizedLocalNodeId;
|
|
29245
29271
|
}
|
|
29272
|
+
if (typeof candidate.passive === 'boolean') {
|
|
29273
|
+
normalized.passive = candidate.passive;
|
|
29274
|
+
}
|
|
29246
29275
|
if (typeof candidate.flowControl === 'boolean') {
|
|
29247
29276
|
normalized.flowControl = candidate.flowControl;
|
|
29248
29277
|
}
|
|
@@ -30586,11 +30615,19 @@ class BroadcastChannelListener extends TransportListener {
|
|
|
30586
30615
|
? Math.floor(initialWindowCandidate)
|
|
30587
30616
|
: undefined;
|
|
30588
30617
|
const initialTargetNodeId = this._normalizeNodeId(targetCandidate) ?? targetSystemId;
|
|
30618
|
+
const passive = typeof passiveCandidate === 'boolean' ? passiveCandidate : true;
|
|
30619
|
+
logger$o.debug('broadcast_channel_listener_building_connector_config', {
|
|
30620
|
+
system_id: systemId,
|
|
30621
|
+
channel_name: channelName,
|
|
30622
|
+
passive,
|
|
30623
|
+
has_base_config: !!baseConfig,
|
|
30624
|
+
passive_candidate: passiveCandidate,
|
|
30625
|
+
});
|
|
30589
30626
|
return {
|
|
30590
30627
|
type: BROADCAST_CHANNEL_CONNECTOR_TYPE,
|
|
30591
30628
|
channelName,
|
|
30592
30629
|
inboxCapacity,
|
|
30593
|
-
passive
|
|
30630
|
+
passive,
|
|
30594
30631
|
initialWindow,
|
|
30595
30632
|
localNodeId,
|
|
30596
30633
|
initialTargetNodeId,
|
package/dist/browser/index.mjs
CHANGED
|
@@ -96,12 +96,12 @@ installProcessEnvShim();
|
|
|
96
96
|
// --- END ENV SHIM ---
|
|
97
97
|
|
|
98
98
|
// This file is auto-generated during build - do not edit manually
|
|
99
|
-
// Generated from package.json version: 0.3.6-test.
|
|
99
|
+
// Generated from package.json version: 0.3.6-test.107
|
|
100
100
|
/**
|
|
101
101
|
* The package version, injected at build time.
|
|
102
102
|
* @internal
|
|
103
103
|
*/
|
|
104
|
-
const VERSION = '0.3.6-test.
|
|
104
|
+
const VERSION = '0.3.6-test.107';
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
107
|
* Fame protocol specific error classes with WebSocket close codes and proper inheritance.
|
|
@@ -7654,9 +7654,9 @@ class DefaultDeliveryTracker extends TaskSpawner {
|
|
|
7654
7654
|
});
|
|
7655
7655
|
await this.markDoneSince(this.replyFutures, trackedEnvelope.originalEnvelope.id, this.replyDoneSince);
|
|
7656
7656
|
await this.markDoneSince(this.ackFutures, trackedEnvelope.originalEnvelope.id, this.ackDoneSince);
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7657
|
+
// Note: ACK is already sent in onCorrelatedMessage (lines 655-657)
|
|
7658
|
+
// when the reply envelope is first delivered. No need to send it again here.
|
|
7659
|
+
// Removing this duplicate sendAck call fixes the duplicate DeliveryAck bug.
|
|
7660
7660
|
for (const handler of this.eventHandlers) {
|
|
7661
7661
|
await handler.onEnvelopeReplied?.(trackedEnvelope, envelope);
|
|
7662
7662
|
}
|
|
@@ -9994,6 +9994,7 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
9994
9994
|
local_node_id: this.localNodeId,
|
|
9995
9995
|
target_node_id: this.targetNodeId ?? null,
|
|
9996
9996
|
inbox_capacity: preferredCapacity,
|
|
9997
|
+
passive: config.passive ?? false,
|
|
9997
9998
|
timestamp: new Date().toISOString(),
|
|
9998
9999
|
});
|
|
9999
10000
|
this.onMsg = (event) => {
|
|
@@ -10861,12 +10862,20 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10861
10862
|
await connector.start(this.wrappedHandler);
|
|
10862
10863
|
this.connector = connector;
|
|
10863
10864
|
const callbackGrants = this.node.gatherSupportedCallbackGrants();
|
|
10865
|
+
logger$Z.debug('callback_grants_before_augmentation', {
|
|
10866
|
+
count: callbackGrants.length,
|
|
10867
|
+
types: callbackGrants.map(g => g.type),
|
|
10868
|
+
});
|
|
10864
10869
|
// Check if we should create a broadcast callback grant before processing connection grants
|
|
10865
10870
|
// This prevents adding duplicate broadcast grants
|
|
10866
10871
|
const shouldAddBroadcastGrant = this.shouldAdvertiseBroadcastGrant(grant, callbackGrants);
|
|
10867
10872
|
const broadcastCallbackGrant = shouldAddBroadcastGrant
|
|
10868
10873
|
? this.createBroadcastCallbackGrant(grant)
|
|
10869
10874
|
: null;
|
|
10875
|
+
logger$Z.debug('broadcast_callback_grant_check', {
|
|
10876
|
+
should_add: shouldAddBroadcastGrant,
|
|
10877
|
+
grant_created: !!broadcastCallbackGrant,
|
|
10878
|
+
});
|
|
10870
10879
|
// Include admission client's connection grants as callback grants
|
|
10871
10880
|
// This ensures DirectAdmissionClient grants are available for grant selection
|
|
10872
10881
|
if (welcome.frame.connectionGrants && Array.isArray(welcome.frame.connectionGrants)) {
|
|
@@ -10876,6 +10885,14 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10876
10885
|
const isDuplicate = callbackGrants.some(existing => JSON.stringify(existing) === JSON.stringify(grant));
|
|
10877
10886
|
if (!isDuplicate) {
|
|
10878
10887
|
callbackGrants.push(grant);
|
|
10888
|
+
logger$Z.debug('added_connection_grant_as_callback', {
|
|
10889
|
+
type: grant.type,
|
|
10890
|
+
});
|
|
10891
|
+
}
|
|
10892
|
+
else {
|
|
10893
|
+
logger$Z.debug('skipped_duplicate_connection_grant', {
|
|
10894
|
+
type: grant.type,
|
|
10895
|
+
});
|
|
10879
10896
|
}
|
|
10880
10897
|
}
|
|
10881
10898
|
}
|
|
@@ -10884,7 +10901,15 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10884
10901
|
// any broadcast grants that may have been in connectionGrants
|
|
10885
10902
|
if (broadcastCallbackGrant && this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
|
|
10886
10903
|
callbackGrants.push(broadcastCallbackGrant);
|
|
10904
|
+
logger$Z.debug('added_broadcast_callback_grant');
|
|
10905
|
+
}
|
|
10906
|
+
else if (broadcastCallbackGrant) {
|
|
10907
|
+
logger$Z.debug('skipped_duplicate_broadcast_callback_grant');
|
|
10887
10908
|
}
|
|
10909
|
+
logger$Z.debug('callback_grants_after_augmentation', {
|
|
10910
|
+
count: callbackGrants.length,
|
|
10911
|
+
types: callbackGrants.map(g => g.type),
|
|
10912
|
+
});
|
|
10888
10913
|
const attachInfo = await this.attachClient.attach(this.node, this.outboundOriginType, connector, welcome.frame, this.wrappedHandler, this.getKeys() ?? undefined, callbackGrants);
|
|
10889
10914
|
this.targetSystemId = attachInfo.targetSystemId ?? null;
|
|
10890
10915
|
if (this.targetSystemId) {
|
|
@@ -29203,6 +29228,7 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
29203
29228
|
inboxCapacity,
|
|
29204
29229
|
localNodeId,
|
|
29205
29230
|
initialTargetNodeId: resolvedTarget,
|
|
29231
|
+
passive: normalized.passive,
|
|
29206
29232
|
};
|
|
29207
29233
|
const connector = new BroadcastChannelConnector(connectorConfig, baseConfig);
|
|
29208
29234
|
if (options.authorization) {
|
|
@@ -29241,6 +29267,9 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
29241
29267
|
if (normalizedLocalNodeId) {
|
|
29242
29268
|
normalized.localNodeId = normalizedLocalNodeId;
|
|
29243
29269
|
}
|
|
29270
|
+
if (typeof candidate.passive === 'boolean') {
|
|
29271
|
+
normalized.passive = candidate.passive;
|
|
29272
|
+
}
|
|
29244
29273
|
if (typeof candidate.flowControl === 'boolean') {
|
|
29245
29274
|
normalized.flowControl = candidate.flowControl;
|
|
29246
29275
|
}
|
|
@@ -30584,11 +30613,19 @@ class BroadcastChannelListener extends TransportListener {
|
|
|
30584
30613
|
? Math.floor(initialWindowCandidate)
|
|
30585
30614
|
: undefined;
|
|
30586
30615
|
const initialTargetNodeId = this._normalizeNodeId(targetCandidate) ?? targetSystemId;
|
|
30616
|
+
const passive = typeof passiveCandidate === 'boolean' ? passiveCandidate : true;
|
|
30617
|
+
logger$o.debug('broadcast_channel_listener_building_connector_config', {
|
|
30618
|
+
system_id: systemId,
|
|
30619
|
+
channel_name: channelName,
|
|
30620
|
+
passive,
|
|
30621
|
+
has_base_config: !!baseConfig,
|
|
30622
|
+
passive_candidate: passiveCandidate,
|
|
30623
|
+
});
|
|
30587
30624
|
return {
|
|
30588
30625
|
type: BROADCAST_CHANNEL_CONNECTOR_TYPE,
|
|
30589
30626
|
channelName,
|
|
30590
30627
|
inboxCapacity,
|
|
30591
|
-
passive
|
|
30628
|
+
passive,
|
|
30592
30629
|
initialWindow,
|
|
30593
30630
|
localNodeId,
|
|
30594
30631
|
initialTargetNodeId,
|
|
@@ -101,6 +101,7 @@ class BroadcastChannelConnectorFactory extends connector_factory_js_1.ConnectorF
|
|
|
101
101
|
inboxCapacity,
|
|
102
102
|
localNodeId,
|
|
103
103
|
initialTargetNodeId: resolvedTarget,
|
|
104
|
+
passive: normalized.passive,
|
|
104
105
|
};
|
|
105
106
|
const connector = new broadcast_channel_connector_js_1.BroadcastChannelConnector(connectorConfig, baseConfig);
|
|
106
107
|
if (options.authorization) {
|
|
@@ -139,6 +140,9 @@ class BroadcastChannelConnectorFactory extends connector_factory_js_1.ConnectorF
|
|
|
139
140
|
if (normalizedLocalNodeId) {
|
|
140
141
|
normalized.localNodeId = normalizedLocalNodeId;
|
|
141
142
|
}
|
|
143
|
+
if (typeof candidate.passive === 'boolean') {
|
|
144
|
+
normalized.passive = candidate.passive;
|
|
145
|
+
}
|
|
142
146
|
if (typeof candidate.flowControl === 'boolean') {
|
|
143
147
|
normalized.flowControl = candidate.flowControl;
|
|
144
148
|
}
|
|
@@ -99,6 +99,7 @@ class BroadcastChannelConnector extends base_async_connector_js_1.BaseAsyncConne
|
|
|
99
99
|
local_node_id: this.localNodeId,
|
|
100
100
|
target_node_id: this.targetNodeId ?? null,
|
|
101
101
|
inbox_capacity: preferredCapacity,
|
|
102
|
+
passive: config.passive ?? false,
|
|
102
103
|
timestamp: new Date().toISOString(),
|
|
103
104
|
});
|
|
104
105
|
this.onMsg = (event) => {
|
|
@@ -455,11 +455,19 @@ class BroadcastChannelListener extends transport_listener_js_1.TransportListener
|
|
|
455
455
|
? Math.floor(initialWindowCandidate)
|
|
456
456
|
: undefined;
|
|
457
457
|
const initialTargetNodeId = this._normalizeNodeId(targetCandidate) ?? targetSystemId;
|
|
458
|
+
const passive = typeof passiveCandidate === 'boolean' ? passiveCandidate : true;
|
|
459
|
+
logger.debug('broadcast_channel_listener_building_connector_config', {
|
|
460
|
+
system_id: systemId,
|
|
461
|
+
channel_name: channelName,
|
|
462
|
+
passive,
|
|
463
|
+
has_base_config: !!baseConfig,
|
|
464
|
+
passive_candidate: passiveCandidate,
|
|
465
|
+
});
|
|
458
466
|
return {
|
|
459
467
|
type: broadcast_channel_connector_js_1.BROADCAST_CHANNEL_CONNECTOR_TYPE,
|
|
460
468
|
channelName,
|
|
461
469
|
inboxCapacity,
|
|
462
|
-
passive
|
|
470
|
+
passive,
|
|
463
471
|
initialWindow,
|
|
464
472
|
localNodeId,
|
|
465
473
|
initialTargetNodeId,
|
|
@@ -648,9 +648,9 @@ class DefaultDeliveryTracker extends task_spawner_js_1.TaskSpawner {
|
|
|
648
648
|
});
|
|
649
649
|
await this.markDoneSince(this.replyFutures, trackedEnvelope.originalEnvelope.id, this.replyDoneSince);
|
|
650
650
|
await this.markDoneSince(this.ackFutures, trackedEnvelope.originalEnvelope.id, this.ackDoneSince);
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
651
|
+
// Note: ACK is already sent in onCorrelatedMessage (lines 655-657)
|
|
652
|
+
// when the reply envelope is first delivered. No need to send it again here.
|
|
653
|
+
// Removing this duplicate sendAck call fixes the duplicate DeliveryAck bug.
|
|
654
654
|
for (const handler of this.eventHandlers) {
|
|
655
655
|
await handler.onEnvelopeReplied?.(trackedEnvelope, envelope);
|
|
656
656
|
}
|
|
@@ -321,12 +321,20 @@ class UpstreamSessionManager extends task_spawner_js_1.TaskSpawner {
|
|
|
321
321
|
await connector.start(this.wrappedHandler);
|
|
322
322
|
this.connector = connector;
|
|
323
323
|
const callbackGrants = this.node.gatherSupportedCallbackGrants();
|
|
324
|
+
logger.debug('callback_grants_before_augmentation', {
|
|
325
|
+
count: callbackGrants.length,
|
|
326
|
+
types: callbackGrants.map(g => g.type),
|
|
327
|
+
});
|
|
324
328
|
// Check if we should create a broadcast callback grant before processing connection grants
|
|
325
329
|
// This prevents adding duplicate broadcast grants
|
|
326
330
|
const shouldAddBroadcastGrant = this.shouldAdvertiseBroadcastGrant(grant, callbackGrants);
|
|
327
331
|
const broadcastCallbackGrant = shouldAddBroadcastGrant
|
|
328
332
|
? this.createBroadcastCallbackGrant(grant)
|
|
329
333
|
: null;
|
|
334
|
+
logger.debug('broadcast_callback_grant_check', {
|
|
335
|
+
should_add: shouldAddBroadcastGrant,
|
|
336
|
+
grant_created: !!broadcastCallbackGrant,
|
|
337
|
+
});
|
|
330
338
|
// Include admission client's connection grants as callback grants
|
|
331
339
|
// This ensures DirectAdmissionClient grants are available for grant selection
|
|
332
340
|
if (welcome.frame.connectionGrants && Array.isArray(welcome.frame.connectionGrants)) {
|
|
@@ -336,6 +344,14 @@ class UpstreamSessionManager extends task_spawner_js_1.TaskSpawner {
|
|
|
336
344
|
const isDuplicate = callbackGrants.some(existing => JSON.stringify(existing) === JSON.stringify(grant));
|
|
337
345
|
if (!isDuplicate) {
|
|
338
346
|
callbackGrants.push(grant);
|
|
347
|
+
logger.debug('added_connection_grant_as_callback', {
|
|
348
|
+
type: grant.type,
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
logger.debug('skipped_duplicate_connection_grant', {
|
|
353
|
+
type: grant.type,
|
|
354
|
+
});
|
|
339
355
|
}
|
|
340
356
|
}
|
|
341
357
|
}
|
|
@@ -344,7 +360,15 @@ class UpstreamSessionManager extends task_spawner_js_1.TaskSpawner {
|
|
|
344
360
|
// any broadcast grants that may have been in connectionGrants
|
|
345
361
|
if (broadcastCallbackGrant && this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
|
|
346
362
|
callbackGrants.push(broadcastCallbackGrant);
|
|
363
|
+
logger.debug('added_broadcast_callback_grant');
|
|
364
|
+
}
|
|
365
|
+
else if (broadcastCallbackGrant) {
|
|
366
|
+
logger.debug('skipped_duplicate_broadcast_callback_grant');
|
|
347
367
|
}
|
|
368
|
+
logger.debug('callback_grants_after_augmentation', {
|
|
369
|
+
count: callbackGrants.length,
|
|
370
|
+
types: callbackGrants.map(g => g.type),
|
|
371
|
+
});
|
|
348
372
|
const attachInfo = await this.attachClient.attach(this.node, this.outboundOriginType, connector, welcome.frame, this.wrappedHandler, this.getKeys() ?? undefined, callbackGrants);
|
|
349
373
|
this.targetSystemId = attachInfo.targetSystemId ?? null;
|
|
350
374
|
if (this.targetSystemId) {
|
package/dist/cjs/version.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file is auto-generated during build - do not edit manually
|
|
3
|
-
// Generated from package.json version: 0.3.6-test.
|
|
3
|
+
// Generated from package.json version: 0.3.6-test.107
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.VERSION = void 0;
|
|
6
6
|
/**
|
|
7
7
|
* The package version, injected at build time.
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
exports.VERSION = '0.3.6-test.
|
|
10
|
+
exports.VERSION = '0.3.6-test.107';
|
|
@@ -98,6 +98,7 @@ export class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
98
98
|
inboxCapacity,
|
|
99
99
|
localNodeId,
|
|
100
100
|
initialTargetNodeId: resolvedTarget,
|
|
101
|
+
passive: normalized.passive,
|
|
101
102
|
};
|
|
102
103
|
const connector = new BroadcastChannelConnector(connectorConfig, baseConfig);
|
|
103
104
|
if (options.authorization) {
|
|
@@ -136,6 +137,9 @@ export class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
136
137
|
if (normalizedLocalNodeId) {
|
|
137
138
|
normalized.localNodeId = normalizedLocalNodeId;
|
|
138
139
|
}
|
|
140
|
+
if (typeof candidate.passive === 'boolean') {
|
|
141
|
+
normalized.passive = candidate.passive;
|
|
142
|
+
}
|
|
139
143
|
if (typeof candidate.flowControl === 'boolean') {
|
|
140
144
|
normalized.flowControl = candidate.flowControl;
|
|
141
145
|
}
|
|
@@ -96,6 +96,7 @@ export class BroadcastChannelConnector extends BaseAsyncConnector {
|
|
|
96
96
|
local_node_id: this.localNodeId,
|
|
97
97
|
target_node_id: this.targetNodeId ?? null,
|
|
98
98
|
inbox_capacity: preferredCapacity,
|
|
99
|
+
passive: config.passive ?? false,
|
|
99
100
|
timestamp: new Date().toISOString(),
|
|
100
101
|
});
|
|
101
102
|
this.onMsg = (event) => {
|
|
@@ -451,11 +451,19 @@ export class BroadcastChannelListener extends TransportListener {
|
|
|
451
451
|
? Math.floor(initialWindowCandidate)
|
|
452
452
|
: undefined;
|
|
453
453
|
const initialTargetNodeId = this._normalizeNodeId(targetCandidate) ?? targetSystemId;
|
|
454
|
+
const passive = typeof passiveCandidate === 'boolean' ? passiveCandidate : true;
|
|
455
|
+
logger.debug('broadcast_channel_listener_building_connector_config', {
|
|
456
|
+
system_id: systemId,
|
|
457
|
+
channel_name: channelName,
|
|
458
|
+
passive,
|
|
459
|
+
has_base_config: !!baseConfig,
|
|
460
|
+
passive_candidate: passiveCandidate,
|
|
461
|
+
});
|
|
454
462
|
return {
|
|
455
463
|
type: BROADCAST_CHANNEL_CONNECTOR_TYPE,
|
|
456
464
|
channelName,
|
|
457
465
|
inboxCapacity,
|
|
458
|
-
passive
|
|
466
|
+
passive,
|
|
459
467
|
initialWindow,
|
|
460
468
|
localNodeId,
|
|
461
469
|
initialTargetNodeId,
|
|
@@ -645,9 +645,9 @@ export class DefaultDeliveryTracker extends TaskSpawner {
|
|
|
645
645
|
});
|
|
646
646
|
await this.markDoneSince(this.replyFutures, trackedEnvelope.originalEnvelope.id, this.replyDoneSince);
|
|
647
647
|
await this.markDoneSince(this.ackFutures, trackedEnvelope.originalEnvelope.id, this.ackDoneSince);
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
648
|
+
// Note: ACK is already sent in onCorrelatedMessage (lines 655-657)
|
|
649
|
+
// when the reply envelope is first delivered. No need to send it again here.
|
|
650
|
+
// Removing this duplicate sendAck call fixes the duplicate DeliveryAck bug.
|
|
651
651
|
for (const handler of this.eventHandlers) {
|
|
652
652
|
await handler.onEnvelopeReplied?.(trackedEnvelope, envelope);
|
|
653
653
|
}
|
|
@@ -318,12 +318,20 @@ export class UpstreamSessionManager extends TaskSpawner {
|
|
|
318
318
|
await connector.start(this.wrappedHandler);
|
|
319
319
|
this.connector = connector;
|
|
320
320
|
const callbackGrants = this.node.gatherSupportedCallbackGrants();
|
|
321
|
+
logger.debug('callback_grants_before_augmentation', {
|
|
322
|
+
count: callbackGrants.length,
|
|
323
|
+
types: callbackGrants.map(g => g.type),
|
|
324
|
+
});
|
|
321
325
|
// Check if we should create a broadcast callback grant before processing connection grants
|
|
322
326
|
// This prevents adding duplicate broadcast grants
|
|
323
327
|
const shouldAddBroadcastGrant = this.shouldAdvertiseBroadcastGrant(grant, callbackGrants);
|
|
324
328
|
const broadcastCallbackGrant = shouldAddBroadcastGrant
|
|
325
329
|
? this.createBroadcastCallbackGrant(grant)
|
|
326
330
|
: null;
|
|
331
|
+
logger.debug('broadcast_callback_grant_check', {
|
|
332
|
+
should_add: shouldAddBroadcastGrant,
|
|
333
|
+
grant_created: !!broadcastCallbackGrant,
|
|
334
|
+
});
|
|
327
335
|
// Include admission client's connection grants as callback grants
|
|
328
336
|
// This ensures DirectAdmissionClient grants are available for grant selection
|
|
329
337
|
if (welcome.frame.connectionGrants && Array.isArray(welcome.frame.connectionGrants)) {
|
|
@@ -333,6 +341,14 @@ export class UpstreamSessionManager extends TaskSpawner {
|
|
|
333
341
|
const isDuplicate = callbackGrants.some(existing => JSON.stringify(existing) === JSON.stringify(grant));
|
|
334
342
|
if (!isDuplicate) {
|
|
335
343
|
callbackGrants.push(grant);
|
|
344
|
+
logger.debug('added_connection_grant_as_callback', {
|
|
345
|
+
type: grant.type,
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
logger.debug('skipped_duplicate_connection_grant', {
|
|
350
|
+
type: grant.type,
|
|
351
|
+
});
|
|
336
352
|
}
|
|
337
353
|
}
|
|
338
354
|
}
|
|
@@ -341,7 +357,15 @@ export class UpstreamSessionManager extends TaskSpawner {
|
|
|
341
357
|
// any broadcast grants that may have been in connectionGrants
|
|
342
358
|
if (broadcastCallbackGrant && this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
|
|
343
359
|
callbackGrants.push(broadcastCallbackGrant);
|
|
360
|
+
logger.debug('added_broadcast_callback_grant');
|
|
361
|
+
}
|
|
362
|
+
else if (broadcastCallbackGrant) {
|
|
363
|
+
logger.debug('skipped_duplicate_broadcast_callback_grant');
|
|
344
364
|
}
|
|
365
|
+
logger.debug('callback_grants_after_augmentation', {
|
|
366
|
+
count: callbackGrants.length,
|
|
367
|
+
types: callbackGrants.map(g => g.type),
|
|
368
|
+
});
|
|
345
369
|
const attachInfo = await this.attachClient.attach(this.node, this.outboundOriginType, connector, welcome.frame, this.wrappedHandler, this.getKeys() ?? undefined, callbackGrants);
|
|
346
370
|
this.targetSystemId = attachInfo.targetSystemId ?? null;
|
|
347
371
|
if (this.targetSystemId) {
|
package/dist/esm/version.js
CHANGED
|
@@ -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.6-test.
|
|
2
|
+
// Generated from package.json version: 0.3.6-test.107
|
|
3
3
|
/**
|
|
4
4
|
* The package version, injected at build time.
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export const VERSION = '0.3.6-test.
|
|
7
|
+
export const VERSION = '0.3.6-test.107';
|
package/dist/node/index.cjs
CHANGED
|
@@ -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.6-test.
|
|
17
|
+
// Generated from package.json version: 0.3.6-test.107
|
|
18
18
|
/**
|
|
19
19
|
* The package version, injected at build time.
|
|
20
20
|
* @internal
|
|
21
21
|
*/
|
|
22
|
-
const VERSION = '0.3.6-test.
|
|
22
|
+
const VERSION = '0.3.6-test.107';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Fame protocol specific error classes with WebSocket close codes and proper inheritance.
|
|
@@ -7572,9 +7572,9 @@ class DefaultDeliveryTracker extends TaskSpawner {
|
|
|
7572
7572
|
});
|
|
7573
7573
|
await this.markDoneSince(this.replyFutures, trackedEnvelope.originalEnvelope.id, this.replyDoneSince);
|
|
7574
7574
|
await this.markDoneSince(this.ackFutures, trackedEnvelope.originalEnvelope.id, this.ackDoneSince);
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7575
|
+
// Note: ACK is already sent in onCorrelatedMessage (lines 655-657)
|
|
7576
|
+
// when the reply envelope is first delivered. No need to send it again here.
|
|
7577
|
+
// Removing this duplicate sendAck call fixes the duplicate DeliveryAck bug.
|
|
7578
7578
|
for (const handler of this.eventHandlers) {
|
|
7579
7579
|
await handler.onEnvelopeReplied?.(trackedEnvelope, envelope);
|
|
7580
7580
|
}
|
|
@@ -9912,6 +9912,7 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
9912
9912
|
local_node_id: this.localNodeId,
|
|
9913
9913
|
target_node_id: this.targetNodeId ?? null,
|
|
9914
9914
|
inbox_capacity: preferredCapacity,
|
|
9915
|
+
passive: config.passive ?? false,
|
|
9915
9916
|
timestamp: new Date().toISOString(),
|
|
9916
9917
|
});
|
|
9917
9918
|
this.onMsg = (event) => {
|
|
@@ -10779,12 +10780,20 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10779
10780
|
await connector.start(this.wrappedHandler);
|
|
10780
10781
|
this.connector = connector;
|
|
10781
10782
|
const callbackGrants = this.node.gatherSupportedCallbackGrants();
|
|
10783
|
+
logger$Z.debug('callback_grants_before_augmentation', {
|
|
10784
|
+
count: callbackGrants.length,
|
|
10785
|
+
types: callbackGrants.map(g => g.type),
|
|
10786
|
+
});
|
|
10782
10787
|
// Check if we should create a broadcast callback grant before processing connection grants
|
|
10783
10788
|
// This prevents adding duplicate broadcast grants
|
|
10784
10789
|
const shouldAddBroadcastGrant = this.shouldAdvertiseBroadcastGrant(grant, callbackGrants);
|
|
10785
10790
|
const broadcastCallbackGrant = shouldAddBroadcastGrant
|
|
10786
10791
|
? this.createBroadcastCallbackGrant(grant)
|
|
10787
10792
|
: null;
|
|
10793
|
+
logger$Z.debug('broadcast_callback_grant_check', {
|
|
10794
|
+
should_add: shouldAddBroadcastGrant,
|
|
10795
|
+
grant_created: !!broadcastCallbackGrant,
|
|
10796
|
+
});
|
|
10788
10797
|
// Include admission client's connection grants as callback grants
|
|
10789
10798
|
// This ensures DirectAdmissionClient grants are available for grant selection
|
|
10790
10799
|
if (welcome.frame.connectionGrants && Array.isArray(welcome.frame.connectionGrants)) {
|
|
@@ -10794,6 +10803,14 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10794
10803
|
const isDuplicate = callbackGrants.some(existing => JSON.stringify(existing) === JSON.stringify(grant));
|
|
10795
10804
|
if (!isDuplicate) {
|
|
10796
10805
|
callbackGrants.push(grant);
|
|
10806
|
+
logger$Z.debug('added_connection_grant_as_callback', {
|
|
10807
|
+
type: grant.type,
|
|
10808
|
+
});
|
|
10809
|
+
}
|
|
10810
|
+
else {
|
|
10811
|
+
logger$Z.debug('skipped_duplicate_connection_grant', {
|
|
10812
|
+
type: grant.type,
|
|
10813
|
+
});
|
|
10797
10814
|
}
|
|
10798
10815
|
}
|
|
10799
10816
|
}
|
|
@@ -10802,7 +10819,15 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10802
10819
|
// any broadcast grants that may have been in connectionGrants
|
|
10803
10820
|
if (broadcastCallbackGrant && this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
|
|
10804
10821
|
callbackGrants.push(broadcastCallbackGrant);
|
|
10822
|
+
logger$Z.debug('added_broadcast_callback_grant');
|
|
10823
|
+
}
|
|
10824
|
+
else if (broadcastCallbackGrant) {
|
|
10825
|
+
logger$Z.debug('skipped_duplicate_broadcast_callback_grant');
|
|
10805
10826
|
}
|
|
10827
|
+
logger$Z.debug('callback_grants_after_augmentation', {
|
|
10828
|
+
count: callbackGrants.length,
|
|
10829
|
+
types: callbackGrants.map(g => g.type),
|
|
10830
|
+
});
|
|
10806
10831
|
const attachInfo = await this.attachClient.attach(this.node, this.outboundOriginType, connector, welcome.frame, this.wrappedHandler, this.getKeys() ?? undefined, callbackGrants);
|
|
10807
10832
|
this.targetSystemId = attachInfo.targetSystemId ?? null;
|
|
10808
10833
|
if (this.targetSystemId) {
|
|
@@ -28923,6 +28948,7 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
28923
28948
|
inboxCapacity,
|
|
28924
28949
|
localNodeId,
|
|
28925
28950
|
initialTargetNodeId: resolvedTarget,
|
|
28951
|
+
passive: normalized.passive,
|
|
28926
28952
|
};
|
|
28927
28953
|
const connector = new BroadcastChannelConnector(connectorConfig, baseConfig);
|
|
28928
28954
|
if (options.authorization) {
|
|
@@ -28961,6 +28987,9 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
28961
28987
|
if (normalizedLocalNodeId) {
|
|
28962
28988
|
normalized.localNodeId = normalizedLocalNodeId;
|
|
28963
28989
|
}
|
|
28990
|
+
if (typeof candidate.passive === 'boolean') {
|
|
28991
|
+
normalized.passive = candidate.passive;
|
|
28992
|
+
}
|
|
28964
28993
|
if (typeof candidate.flowControl === 'boolean') {
|
|
28965
28994
|
normalized.flowControl = candidate.flowControl;
|
|
28966
28995
|
}
|
|
@@ -36755,11 +36784,19 @@ class BroadcastChannelListener extends TransportListener {
|
|
|
36755
36784
|
? Math.floor(initialWindowCandidate)
|
|
36756
36785
|
: undefined;
|
|
36757
36786
|
const initialTargetNodeId = this._normalizeNodeId(targetCandidate) ?? targetSystemId;
|
|
36787
|
+
const passive = typeof passiveCandidate === 'boolean' ? passiveCandidate : true;
|
|
36788
|
+
logger$a.debug('broadcast_channel_listener_building_connector_config', {
|
|
36789
|
+
system_id: systemId,
|
|
36790
|
+
channel_name: channelName,
|
|
36791
|
+
passive,
|
|
36792
|
+
has_base_config: !!baseConfig,
|
|
36793
|
+
passive_candidate: passiveCandidate,
|
|
36794
|
+
});
|
|
36758
36795
|
return {
|
|
36759
36796
|
type: BROADCAST_CHANNEL_CONNECTOR_TYPE,
|
|
36760
36797
|
channelName,
|
|
36761
36798
|
inboxCapacity,
|
|
36762
|
-
passive
|
|
36799
|
+
passive,
|
|
36763
36800
|
initialWindow,
|
|
36764
36801
|
localNodeId,
|
|
36765
36802
|
initialTargetNodeId,
|
package/dist/node/index.mjs
CHANGED
|
@@ -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.6-test.
|
|
16
|
+
// Generated from package.json version: 0.3.6-test.107
|
|
17
17
|
/**
|
|
18
18
|
* The package version, injected at build time.
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
|
-
const VERSION = '0.3.6-test.
|
|
21
|
+
const VERSION = '0.3.6-test.107';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Fame protocol specific error classes with WebSocket close codes and proper inheritance.
|
|
@@ -7571,9 +7571,9 @@ class DefaultDeliveryTracker extends TaskSpawner {
|
|
|
7571
7571
|
});
|
|
7572
7572
|
await this.markDoneSince(this.replyFutures, trackedEnvelope.originalEnvelope.id, this.replyDoneSince);
|
|
7573
7573
|
await this.markDoneSince(this.ackFutures, trackedEnvelope.originalEnvelope.id, this.ackDoneSince);
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7574
|
+
// Note: ACK is already sent in onCorrelatedMessage (lines 655-657)
|
|
7575
|
+
// when the reply envelope is first delivered. No need to send it again here.
|
|
7576
|
+
// Removing this duplicate sendAck call fixes the duplicate DeliveryAck bug.
|
|
7577
7577
|
for (const handler of this.eventHandlers) {
|
|
7578
7578
|
await handler.onEnvelopeReplied?.(trackedEnvelope, envelope);
|
|
7579
7579
|
}
|
|
@@ -9911,6 +9911,7 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
9911
9911
|
local_node_id: this.localNodeId,
|
|
9912
9912
|
target_node_id: this.targetNodeId ?? null,
|
|
9913
9913
|
inbox_capacity: preferredCapacity,
|
|
9914
|
+
passive: config.passive ?? false,
|
|
9914
9915
|
timestamp: new Date().toISOString(),
|
|
9915
9916
|
});
|
|
9916
9917
|
this.onMsg = (event) => {
|
|
@@ -10778,12 +10779,20 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10778
10779
|
await connector.start(this.wrappedHandler);
|
|
10779
10780
|
this.connector = connector;
|
|
10780
10781
|
const callbackGrants = this.node.gatherSupportedCallbackGrants();
|
|
10782
|
+
logger$Z.debug('callback_grants_before_augmentation', {
|
|
10783
|
+
count: callbackGrants.length,
|
|
10784
|
+
types: callbackGrants.map(g => g.type),
|
|
10785
|
+
});
|
|
10781
10786
|
// Check if we should create a broadcast callback grant before processing connection grants
|
|
10782
10787
|
// This prevents adding duplicate broadcast grants
|
|
10783
10788
|
const shouldAddBroadcastGrant = this.shouldAdvertiseBroadcastGrant(grant, callbackGrants);
|
|
10784
10789
|
const broadcastCallbackGrant = shouldAddBroadcastGrant
|
|
10785
10790
|
? this.createBroadcastCallbackGrant(grant)
|
|
10786
10791
|
: null;
|
|
10792
|
+
logger$Z.debug('broadcast_callback_grant_check', {
|
|
10793
|
+
should_add: shouldAddBroadcastGrant,
|
|
10794
|
+
grant_created: !!broadcastCallbackGrant,
|
|
10795
|
+
});
|
|
10787
10796
|
// Include admission client's connection grants as callback grants
|
|
10788
10797
|
// This ensures DirectAdmissionClient grants are available for grant selection
|
|
10789
10798
|
if (welcome.frame.connectionGrants && Array.isArray(welcome.frame.connectionGrants)) {
|
|
@@ -10793,6 +10802,14 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10793
10802
|
const isDuplicate = callbackGrants.some(existing => JSON.stringify(existing) === JSON.stringify(grant));
|
|
10794
10803
|
if (!isDuplicate) {
|
|
10795
10804
|
callbackGrants.push(grant);
|
|
10805
|
+
logger$Z.debug('added_connection_grant_as_callback', {
|
|
10806
|
+
type: grant.type,
|
|
10807
|
+
});
|
|
10808
|
+
}
|
|
10809
|
+
else {
|
|
10810
|
+
logger$Z.debug('skipped_duplicate_connection_grant', {
|
|
10811
|
+
type: grant.type,
|
|
10812
|
+
});
|
|
10796
10813
|
}
|
|
10797
10814
|
}
|
|
10798
10815
|
}
|
|
@@ -10801,7 +10818,15 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
10801
10818
|
// any broadcast grants that may have been in connectionGrants
|
|
10802
10819
|
if (broadcastCallbackGrant && this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
|
|
10803
10820
|
callbackGrants.push(broadcastCallbackGrant);
|
|
10821
|
+
logger$Z.debug('added_broadcast_callback_grant');
|
|
10822
|
+
}
|
|
10823
|
+
else if (broadcastCallbackGrant) {
|
|
10824
|
+
logger$Z.debug('skipped_duplicate_broadcast_callback_grant');
|
|
10804
10825
|
}
|
|
10826
|
+
logger$Z.debug('callback_grants_after_augmentation', {
|
|
10827
|
+
count: callbackGrants.length,
|
|
10828
|
+
types: callbackGrants.map(g => g.type),
|
|
10829
|
+
});
|
|
10805
10830
|
const attachInfo = await this.attachClient.attach(this.node, this.outboundOriginType, connector, welcome.frame, this.wrappedHandler, this.getKeys() ?? undefined, callbackGrants);
|
|
10806
10831
|
this.targetSystemId = attachInfo.targetSystemId ?? null;
|
|
10807
10832
|
if (this.targetSystemId) {
|
|
@@ -28922,6 +28947,7 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
28922
28947
|
inboxCapacity,
|
|
28923
28948
|
localNodeId,
|
|
28924
28949
|
initialTargetNodeId: resolvedTarget,
|
|
28950
|
+
passive: normalized.passive,
|
|
28925
28951
|
};
|
|
28926
28952
|
const connector = new BroadcastChannelConnector(connectorConfig, baseConfig);
|
|
28927
28953
|
if (options.authorization) {
|
|
@@ -28960,6 +28986,9 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
28960
28986
|
if (normalizedLocalNodeId) {
|
|
28961
28987
|
normalized.localNodeId = normalizedLocalNodeId;
|
|
28962
28988
|
}
|
|
28989
|
+
if (typeof candidate.passive === 'boolean') {
|
|
28990
|
+
normalized.passive = candidate.passive;
|
|
28991
|
+
}
|
|
28963
28992
|
if (typeof candidate.flowControl === 'boolean') {
|
|
28964
28993
|
normalized.flowControl = candidate.flowControl;
|
|
28965
28994
|
}
|
|
@@ -36754,11 +36783,19 @@ class BroadcastChannelListener extends TransportListener {
|
|
|
36754
36783
|
? Math.floor(initialWindowCandidate)
|
|
36755
36784
|
: undefined;
|
|
36756
36785
|
const initialTargetNodeId = this._normalizeNodeId(targetCandidate) ?? targetSystemId;
|
|
36786
|
+
const passive = typeof passiveCandidate === 'boolean' ? passiveCandidate : true;
|
|
36787
|
+
logger$a.debug('broadcast_channel_listener_building_connector_config', {
|
|
36788
|
+
system_id: systemId,
|
|
36789
|
+
channel_name: channelName,
|
|
36790
|
+
passive,
|
|
36791
|
+
has_base_config: !!baseConfig,
|
|
36792
|
+
passive_candidate: passiveCandidate,
|
|
36793
|
+
});
|
|
36757
36794
|
return {
|
|
36758
36795
|
type: BROADCAST_CHANNEL_CONNECTOR_TYPE,
|
|
36759
36796
|
channelName,
|
|
36760
36797
|
inboxCapacity,
|
|
36761
|
-
passive
|
|
36798
|
+
passive,
|
|
36762
36799
|
initialWindow,
|
|
36763
36800
|
localNodeId,
|
|
36764
36801
|
initialTargetNodeId,
|
package/dist/node/node.cjs
CHANGED
|
@@ -5563,12 +5563,12 @@ for (const [name, config] of Object.entries(SQLITE_PROFILES)) {
|
|
|
5563
5563
|
}
|
|
5564
5564
|
|
|
5565
5565
|
// This file is auto-generated during build - do not edit manually
|
|
5566
|
-
// Generated from package.json version: 0.3.6-test.
|
|
5566
|
+
// Generated from package.json version: 0.3.6-test.107
|
|
5567
5567
|
/**
|
|
5568
5568
|
* The package version, injected at build time.
|
|
5569
5569
|
* @internal
|
|
5570
5570
|
*/
|
|
5571
|
-
const VERSION = '0.3.6-test.
|
|
5571
|
+
const VERSION = '0.3.6-test.107';
|
|
5572
5572
|
|
|
5573
5573
|
/**
|
|
5574
5574
|
* Fame errors module - Fame protocol specific error classes
|
|
@@ -10226,9 +10226,9 @@ class DefaultDeliveryTracker extends TaskSpawner {
|
|
|
10226
10226
|
});
|
|
10227
10227
|
await this.markDoneSince(this.replyFutures, trackedEnvelope.originalEnvelope.id, this.replyDoneSince);
|
|
10228
10228
|
await this.markDoneSince(this.ackFutures, trackedEnvelope.originalEnvelope.id, this.ackDoneSince);
|
|
10229
|
-
|
|
10230
|
-
|
|
10231
|
-
|
|
10229
|
+
// Note: ACK is already sent in onCorrelatedMessage (lines 655-657)
|
|
10230
|
+
// when the reply envelope is first delivered. No need to send it again here.
|
|
10231
|
+
// Removing this duplicate sendAck call fixes the duplicate DeliveryAck bug.
|
|
10232
10232
|
for (const handler of this.eventHandlers) {
|
|
10233
10233
|
await handler.onEnvelopeReplied?.(trackedEnvelope, envelope);
|
|
10234
10234
|
}
|
|
@@ -11649,6 +11649,7 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
11649
11649
|
local_node_id: this.localNodeId,
|
|
11650
11650
|
target_node_id: this.targetNodeId ?? null,
|
|
11651
11651
|
inbox_capacity: preferredCapacity,
|
|
11652
|
+
passive: config.passive ?? false,
|
|
11652
11653
|
timestamp: new Date().toISOString(),
|
|
11653
11654
|
});
|
|
11654
11655
|
this.onMsg = (event) => {
|
|
@@ -12471,12 +12472,20 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
12471
12472
|
await connector.start(this.wrappedHandler);
|
|
12472
12473
|
this.connector = connector;
|
|
12473
12474
|
const callbackGrants = this.node.gatherSupportedCallbackGrants();
|
|
12475
|
+
logger$$.debug('callback_grants_before_augmentation', {
|
|
12476
|
+
count: callbackGrants.length,
|
|
12477
|
+
types: callbackGrants.map(g => g.type),
|
|
12478
|
+
});
|
|
12474
12479
|
// Check if we should create a broadcast callback grant before processing connection grants
|
|
12475
12480
|
// This prevents adding duplicate broadcast grants
|
|
12476
12481
|
const shouldAddBroadcastGrant = this.shouldAdvertiseBroadcastGrant(grant, callbackGrants);
|
|
12477
12482
|
const broadcastCallbackGrant = shouldAddBroadcastGrant
|
|
12478
12483
|
? this.createBroadcastCallbackGrant(grant)
|
|
12479
12484
|
: null;
|
|
12485
|
+
logger$$.debug('broadcast_callback_grant_check', {
|
|
12486
|
+
should_add: shouldAddBroadcastGrant,
|
|
12487
|
+
grant_created: !!broadcastCallbackGrant,
|
|
12488
|
+
});
|
|
12480
12489
|
// Include admission client's connection grants as callback grants
|
|
12481
12490
|
// This ensures DirectAdmissionClient grants are available for grant selection
|
|
12482
12491
|
if (welcome.frame.connectionGrants && Array.isArray(welcome.frame.connectionGrants)) {
|
|
@@ -12486,6 +12495,14 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
12486
12495
|
const isDuplicate = callbackGrants.some(existing => JSON.stringify(existing) === JSON.stringify(grant));
|
|
12487
12496
|
if (!isDuplicate) {
|
|
12488
12497
|
callbackGrants.push(grant);
|
|
12498
|
+
logger$$.debug('added_connection_grant_as_callback', {
|
|
12499
|
+
type: grant.type,
|
|
12500
|
+
});
|
|
12501
|
+
}
|
|
12502
|
+
else {
|
|
12503
|
+
logger$$.debug('skipped_duplicate_connection_grant', {
|
|
12504
|
+
type: grant.type,
|
|
12505
|
+
});
|
|
12489
12506
|
}
|
|
12490
12507
|
}
|
|
12491
12508
|
}
|
|
@@ -12494,7 +12511,15 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
12494
12511
|
// any broadcast grants that may have been in connectionGrants
|
|
12495
12512
|
if (broadcastCallbackGrant && this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
|
|
12496
12513
|
callbackGrants.push(broadcastCallbackGrant);
|
|
12514
|
+
logger$$.debug('added_broadcast_callback_grant');
|
|
12515
|
+
}
|
|
12516
|
+
else if (broadcastCallbackGrant) {
|
|
12517
|
+
logger$$.debug('skipped_duplicate_broadcast_callback_grant');
|
|
12497
12518
|
}
|
|
12519
|
+
logger$$.debug('callback_grants_after_augmentation', {
|
|
12520
|
+
count: callbackGrants.length,
|
|
12521
|
+
types: callbackGrants.map(g => g.type),
|
|
12522
|
+
});
|
|
12498
12523
|
const attachInfo = await this.attachClient.attach(this.node, this.outboundOriginType, connector, welcome.frame, this.wrappedHandler, this.getKeys() ?? undefined, callbackGrants);
|
|
12499
12524
|
this.targetSystemId = attachInfo.targetSystemId ?? null;
|
|
12500
12525
|
if (this.targetSystemId) {
|
|
@@ -30892,6 +30917,7 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
30892
30917
|
inboxCapacity,
|
|
30893
30918
|
localNodeId,
|
|
30894
30919
|
initialTargetNodeId: resolvedTarget,
|
|
30920
|
+
passive: normalized.passive,
|
|
30895
30921
|
};
|
|
30896
30922
|
const connector = new BroadcastChannelConnector(connectorConfig, baseConfig);
|
|
30897
30923
|
if (options.authorization) {
|
|
@@ -30930,6 +30956,9 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
30930
30956
|
if (normalizedLocalNodeId) {
|
|
30931
30957
|
normalized.localNodeId = normalizedLocalNodeId;
|
|
30932
30958
|
}
|
|
30959
|
+
if (typeof candidate.passive === 'boolean') {
|
|
30960
|
+
normalized.passive = candidate.passive;
|
|
30961
|
+
}
|
|
30933
30962
|
if (typeof candidate.flowControl === 'boolean') {
|
|
30934
30963
|
normalized.flowControl = candidate.flowControl;
|
|
30935
30964
|
}
|
|
@@ -33327,11 +33356,19 @@ class BroadcastChannelListener extends TransportListener {
|
|
|
33327
33356
|
? Math.floor(initialWindowCandidate)
|
|
33328
33357
|
: undefined;
|
|
33329
33358
|
const initialTargetNodeId = this._normalizeNodeId(targetCandidate) ?? targetSystemId;
|
|
33359
|
+
const passive = typeof passiveCandidate === 'boolean' ? passiveCandidate : true;
|
|
33360
|
+
logger$n.debug('broadcast_channel_listener_building_connector_config', {
|
|
33361
|
+
system_id: systemId,
|
|
33362
|
+
channel_name: channelName,
|
|
33363
|
+
passive,
|
|
33364
|
+
has_base_config: !!baseConfig,
|
|
33365
|
+
passive_candidate: passiveCandidate,
|
|
33366
|
+
});
|
|
33330
33367
|
return {
|
|
33331
33368
|
type: BROADCAST_CHANNEL_CONNECTOR_TYPE$1,
|
|
33332
33369
|
channelName,
|
|
33333
33370
|
inboxCapacity,
|
|
33334
|
-
passive
|
|
33371
|
+
passive,
|
|
33335
33372
|
initialWindow,
|
|
33336
33373
|
localNodeId,
|
|
33337
33374
|
initialTargetNodeId,
|
package/dist/node/node.mjs
CHANGED
|
@@ -5562,12 +5562,12 @@ for (const [name, config] of Object.entries(SQLITE_PROFILES)) {
|
|
|
5562
5562
|
}
|
|
5563
5563
|
|
|
5564
5564
|
// This file is auto-generated during build - do not edit manually
|
|
5565
|
-
// Generated from package.json version: 0.3.6-test.
|
|
5565
|
+
// Generated from package.json version: 0.3.6-test.107
|
|
5566
5566
|
/**
|
|
5567
5567
|
* The package version, injected at build time.
|
|
5568
5568
|
* @internal
|
|
5569
5569
|
*/
|
|
5570
|
-
const VERSION = '0.3.6-test.
|
|
5570
|
+
const VERSION = '0.3.6-test.107';
|
|
5571
5571
|
|
|
5572
5572
|
/**
|
|
5573
5573
|
* Fame errors module - Fame protocol specific error classes
|
|
@@ -10225,9 +10225,9 @@ class DefaultDeliveryTracker extends TaskSpawner {
|
|
|
10225
10225
|
});
|
|
10226
10226
|
await this.markDoneSince(this.replyFutures, trackedEnvelope.originalEnvelope.id, this.replyDoneSince);
|
|
10227
10227
|
await this.markDoneSince(this.ackFutures, trackedEnvelope.originalEnvelope.id, this.ackDoneSince);
|
|
10228
|
-
|
|
10229
|
-
|
|
10230
|
-
|
|
10228
|
+
// Note: ACK is already sent in onCorrelatedMessage (lines 655-657)
|
|
10229
|
+
// when the reply envelope is first delivered. No need to send it again here.
|
|
10230
|
+
// Removing this duplicate sendAck call fixes the duplicate DeliveryAck bug.
|
|
10231
10231
|
for (const handler of this.eventHandlers) {
|
|
10232
10232
|
await handler.onEnvelopeReplied?.(trackedEnvelope, envelope);
|
|
10233
10233
|
}
|
|
@@ -11648,6 +11648,7 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
|
|
|
11648
11648
|
local_node_id: this.localNodeId,
|
|
11649
11649
|
target_node_id: this.targetNodeId ?? null,
|
|
11650
11650
|
inbox_capacity: preferredCapacity,
|
|
11651
|
+
passive: config.passive ?? false,
|
|
11651
11652
|
timestamp: new Date().toISOString(),
|
|
11652
11653
|
});
|
|
11653
11654
|
this.onMsg = (event) => {
|
|
@@ -12470,12 +12471,20 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
12470
12471
|
await connector.start(this.wrappedHandler);
|
|
12471
12472
|
this.connector = connector;
|
|
12472
12473
|
const callbackGrants = this.node.gatherSupportedCallbackGrants();
|
|
12474
|
+
logger$$.debug('callback_grants_before_augmentation', {
|
|
12475
|
+
count: callbackGrants.length,
|
|
12476
|
+
types: callbackGrants.map(g => g.type),
|
|
12477
|
+
});
|
|
12473
12478
|
// Check if we should create a broadcast callback grant before processing connection grants
|
|
12474
12479
|
// This prevents adding duplicate broadcast grants
|
|
12475
12480
|
const shouldAddBroadcastGrant = this.shouldAdvertiseBroadcastGrant(grant, callbackGrants);
|
|
12476
12481
|
const broadcastCallbackGrant = shouldAddBroadcastGrant
|
|
12477
12482
|
? this.createBroadcastCallbackGrant(grant)
|
|
12478
12483
|
: null;
|
|
12484
|
+
logger$$.debug('broadcast_callback_grant_check', {
|
|
12485
|
+
should_add: shouldAddBroadcastGrant,
|
|
12486
|
+
grant_created: !!broadcastCallbackGrant,
|
|
12487
|
+
});
|
|
12479
12488
|
// Include admission client's connection grants as callback grants
|
|
12480
12489
|
// This ensures DirectAdmissionClient grants are available for grant selection
|
|
12481
12490
|
if (welcome.frame.connectionGrants && Array.isArray(welcome.frame.connectionGrants)) {
|
|
@@ -12485,6 +12494,14 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
12485
12494
|
const isDuplicate = callbackGrants.some(existing => JSON.stringify(existing) === JSON.stringify(grant));
|
|
12486
12495
|
if (!isDuplicate) {
|
|
12487
12496
|
callbackGrants.push(grant);
|
|
12497
|
+
logger$$.debug('added_connection_grant_as_callback', {
|
|
12498
|
+
type: grant.type,
|
|
12499
|
+
});
|
|
12500
|
+
}
|
|
12501
|
+
else {
|
|
12502
|
+
logger$$.debug('skipped_duplicate_connection_grant', {
|
|
12503
|
+
type: grant.type,
|
|
12504
|
+
});
|
|
12488
12505
|
}
|
|
12489
12506
|
}
|
|
12490
12507
|
}
|
|
@@ -12493,7 +12510,15 @@ class UpstreamSessionManager extends TaskSpawner {
|
|
|
12493
12510
|
// any broadcast grants that may have been in connectionGrants
|
|
12494
12511
|
if (broadcastCallbackGrant && this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
|
|
12495
12512
|
callbackGrants.push(broadcastCallbackGrant);
|
|
12513
|
+
logger$$.debug('added_broadcast_callback_grant');
|
|
12514
|
+
}
|
|
12515
|
+
else if (broadcastCallbackGrant) {
|
|
12516
|
+
logger$$.debug('skipped_duplicate_broadcast_callback_grant');
|
|
12496
12517
|
}
|
|
12518
|
+
logger$$.debug('callback_grants_after_augmentation', {
|
|
12519
|
+
count: callbackGrants.length,
|
|
12520
|
+
types: callbackGrants.map(g => g.type),
|
|
12521
|
+
});
|
|
12497
12522
|
const attachInfo = await this.attachClient.attach(this.node, this.outboundOriginType, connector, welcome.frame, this.wrappedHandler, this.getKeys() ?? undefined, callbackGrants);
|
|
12498
12523
|
this.targetSystemId = attachInfo.targetSystemId ?? null;
|
|
12499
12524
|
if (this.targetSystemId) {
|
|
@@ -30891,6 +30916,7 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
30891
30916
|
inboxCapacity,
|
|
30892
30917
|
localNodeId,
|
|
30893
30918
|
initialTargetNodeId: resolvedTarget,
|
|
30919
|
+
passive: normalized.passive,
|
|
30894
30920
|
};
|
|
30895
30921
|
const connector = new BroadcastChannelConnector(connectorConfig, baseConfig);
|
|
30896
30922
|
if (options.authorization) {
|
|
@@ -30929,6 +30955,9 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
|
|
|
30929
30955
|
if (normalizedLocalNodeId) {
|
|
30930
30956
|
normalized.localNodeId = normalizedLocalNodeId;
|
|
30931
30957
|
}
|
|
30958
|
+
if (typeof candidate.passive === 'boolean') {
|
|
30959
|
+
normalized.passive = candidate.passive;
|
|
30960
|
+
}
|
|
30932
30961
|
if (typeof candidate.flowControl === 'boolean') {
|
|
30933
30962
|
normalized.flowControl = candidate.flowControl;
|
|
30934
30963
|
}
|
|
@@ -33326,11 +33355,19 @@ class BroadcastChannelListener extends TransportListener {
|
|
|
33326
33355
|
? Math.floor(initialWindowCandidate)
|
|
33327
33356
|
: undefined;
|
|
33328
33357
|
const initialTargetNodeId = this._normalizeNodeId(targetCandidate) ?? targetSystemId;
|
|
33358
|
+
const passive = typeof passiveCandidate === 'boolean' ? passiveCandidate : true;
|
|
33359
|
+
logger$n.debug('broadcast_channel_listener_building_connector_config', {
|
|
33360
|
+
system_id: systemId,
|
|
33361
|
+
channel_name: channelName,
|
|
33362
|
+
passive,
|
|
33363
|
+
has_base_config: !!baseConfig,
|
|
33364
|
+
passive_candidate: passiveCandidate,
|
|
33365
|
+
});
|
|
33329
33366
|
return {
|
|
33330
33367
|
type: BROADCAST_CHANNEL_CONNECTOR_TYPE$1,
|
|
33331
33368
|
channelName,
|
|
33332
33369
|
inboxCapacity,
|
|
33333
|
-
passive
|
|
33370
|
+
passive,
|
|
33334
33371
|
initialWindow,
|
|
33335
33372
|
localNodeId,
|
|
33336
33373
|
initialTargetNodeId,
|
|
@@ -9,6 +9,7 @@ export interface BroadcastChannelConnectorFactoryConfig extends ConnectorConfig,
|
|
|
9
9
|
inboxCapacity?: number;
|
|
10
10
|
localNodeId?: string;
|
|
11
11
|
initialTargetNodeId?: string | '*';
|
|
12
|
+
passive?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export interface CreateBroadcastChannelConnectorOptions {
|
|
14
15
|
authorization?: AuthorizationContext;
|
package/dist/types/version.d.ts
CHANGED