@camstack/server 1.2.543 → 1.2.544

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.
@@ -49,6 +49,14 @@ function createAgentMeshJoin(opts) {
49
49
  opts.log?.(`mesh inbound: node "${nodeId}" is calling without having authenticated — ` +
50
50
  `tolerated while this agent has no cluster secret (first call: ${action})`);
51
51
  },
52
+ // D848: what the hub sent before the join settled is held, then decided — said here.
53
+ onHoldReport: (r) => {
54
+ const what = `${r.events} hub event(s) and ${r.calls} hub call(s) held ${r.heldForMs} ms before the mesh join settled`;
55
+ const overflow = r.overflow > 0 ? `; ${r.overflow} more refused because the hold was full` : '';
56
+ opts.log?.(r.outcome === 'delivered'
57
+ ? `[mesh-join] ${what}: delivered${overflow}`
58
+ : `[mesh-join] ${what}: REFUSED (join ${r.reason})${overflow}`);
59
+ },
52
60
  });
53
61
  const client = new system_1.MeshJoinClient({
54
62
  nodeId: opts.nodeId,
@@ -77,6 +85,10 @@ function createAgentMeshJoin(opts) {
77
85
  void runJoin();
78
86
  };
79
87
  const joinMiddleware = client.middleware(rejoin);
88
+ const eventScope = (0, system_1.createAgentEventScope)({
89
+ hubNodeId: HUB_NODE_ID,
90
+ ...(opts.log !== undefined ? { log: opts.log } : {}),
91
+ });
80
92
  const inboundMiddleware = (0, system_1.createMeshAccessMiddleware)({
81
93
  ownNodeId: opts.nodeId,
82
94
  authenticator,
@@ -95,7 +107,8 @@ function createAgentMeshJoin(opts) {
95
107
  client,
96
108
  authenticator,
97
109
  middleware: joinMiddleware,
98
- middlewares: [inboundMiddleware, joinMiddleware],
110
+ eventScope,
111
+ middlewares: [inboundMiddleware, joinMiddleware, eventScope.middleware],
99
112
  attach(broker) {
100
113
  broker.localBus.on('$node.connected', (data) => {
101
114
  if (nodeIdOf(data) !== HUB_NODE_ID)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.543",
3
+ "version": "1.2.544",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "files": [
@@ -48,7 +48,7 @@
48
48
  "@camstack/addon-post-analysis": "1.2.360",
49
49
  "@camstack/develop": "0.1.5",
50
50
  "@camstack/sdk": "1.2.131",
51
- "@camstack/system": "1.2.419",
51
+ "@camstack/system": "1.2.420",
52
52
  "@camstack/types": "1.2.357",
53
53
  "@camstack/ui-library": "1.2.281",
54
54
  "@fastify/compress": "^9.0.0",