@qontinui/ui-bridge 0.21.0 → 0.21.1

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.
@@ -25469,7 +25469,12 @@ function handleRelayRoute(method, path, request, relay, config) {
25469
25469
  400
25470
25470
  );
25471
25471
  }
25472
- relay.recordRegistration(heartbeatTabId, { userId, sessionId });
25472
+ const callerUserId = request.headers.get("x-caller-user-id") ?? request.headers.get("X-Caller-User-Id") ?? void 0;
25473
+ const registration = relay.recordRegistration(
25474
+ heartbeatTabId,
25475
+ { userId, sessionId },
25476
+ { callerUserId }
25477
+ );
25473
25478
  relay.receiveHeartbeat(heartbeatTabId, {
25474
25479
  url: typeof body?.url === "string" ? body.url : void 0,
25475
25480
  title: typeof body?.title === "string" ? body.title : void 0,
@@ -25479,7 +25484,15 @@ function handleRelayRoute(method, path, request, relay, config) {
25479
25484
  const tabRegistered = diag.connectedTabs.includes(heartbeatTabId);
25480
25485
  return jsonResponse({
25481
25486
  success: true,
25482
- data: { received: true, tabRegistered },
25487
+ data: {
25488
+ received: true,
25489
+ tabRegistered,
25490
+ // Observability: signals an ownership claim/transfer was refused
25491
+ // because the claimed userId was not auth-proven. Not a fatal
25492
+ // heartbeat error — the loop continues; the tab simply keeps its
25493
+ // prior (or no) owner. Absent when ownership was assigned.
25494
+ ...registration.ownershipAssigned ? {} : { ownershipAssigned: false, ownerChangeRejected: registration.rejectedReason }
25495
+ },
25483
25496
  timestamp: Date.now()
25484
25497
  });
25485
25498
  })();