Repository navigation
fix: stamp the shell's session and user on records a fragment forwards - #31
Conversation
Coverage report
Test suite run success746 tests passing in 24 suites. Report generated by 🧪jest coverage report action from f4be6d5 |
There was a problem hiding this comment.
🟡 Changes recommended
An active moderate issue remains because empty user IDs are not normalized to undefined, causing forwarded records to retain an incorrect user attribution.
1 open issue
What changed in this PR
This pull request updates the broadcast host to stamp fragment-forwarded telemetry with the shell’s current session and user, refresh scenario timing when sessions change, and document the behavior across realms.
Changes:
- Stamps forwarded scenario, step, BI, and log records with the host identity.
- Recalculates
sessionElapsedwhen a forwarded scenario changes sessions. - Adds regression coverage and updates the design documentation.
- Requires changes to normalize an empty host user ID as signed out.
| File | Summary |
|---|---|
projects/ngx-ui-watchtower/src/lib/sinks/uwt-broadcast/uwt-broadcast-host.service.ts |
Implements host identity stamping and session timing correction. A moderate issue remains: empty user IDs are not omitted. |
projects/ngx-ui-watchtower/src/lib/sinks/uwt-broadcast/uwt-broadcast.spec.ts |
Tests late session initialization, stale identities, custom events, and forwarded logs. |
projects/ngx-ui-watchtower/DESIGN.md |
Documents identity correction across realms and updated sessionElapsed behavior. |
Review effort: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is warranted because the new scenario-step classification and stamping branch lacks dedicated test coverage for stale session and user identifiers when lifecycle events are enabled.
No open issues 🎉
1 resolved since last review
Review effort: Lite
…-a-missing-expired-or-signed-out-session-and-user

Overview
A fragment's scenario, BI and log records no longer go out with a missing, expired or signed-out session and user. The shell's broadcast host stamps its own current session and user on what a fragment forwards. A fragment's own copy can lag behind: the shell's RUM client starting after the fragment asked, a session expiring, or a sign-out in the shell.
Key Changes
UwtTelemetryBroadcastHost):sessionIdanduserId;sessionElapsedis measured again when its session changed;undefined, as in the library's own records (''counts as no user);sessionElapsedsections describe the stamping and its one limit: while the shell's RUM client hasn't started, the host has no session to stamp.Impact on consumers
Closes #30