WS-3212: Introduce client-side error tracking for IDCTA and UAS - #14377
Open
elvinasv wants to merge 12 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
It introduces a type-safety regression in shared Reverb event typing and the implementation scope appears to diverge from the stated “IDCTA and UAS” tracking goal.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR introduces a new client-side “error” analytics beacon (Piano/Reverb) and wires it into the UAS save/remove flow so client-side failures can be tracked with richer diagnostic context (status + service error code/message when available).
Changes:
- Add a new
buildErrorEventModel+sendErrorEventutility to send standalone Reverb “error” beacons. - Extend UAS error handling to capture error bodies (JSON
{ key, message }or plain text) and expose them viaUasError. - Add
useErrorTrackingand integrate it intouseUASButton(including offline filtering) while updating Reverb beacon plumbing/types to support the newerrorevent.
File summaries
| File | Description |
|---|---|
| src/app/lib/uasApi/index.ts | Parses UAS error bodies and passes diagnostic detail into UasError. |
| src/app/lib/uasApi/index.test.ts | Adds coverage for JSON vs plain-text UAS error bodies. |
| src/app/lib/uasApi/errors.ts | Extends UasError to carry code and serviceMessage. |
| src/app/lib/analyticsUtils/sendErrorEvent/index.ts | New utility to build and send standalone “error” beacons. |
| src/app/lib/analyticsUtils/sendErrorEvent/index.test.ts | Tests beacon sending/guard conditions for error events. |
| src/app/lib/analyticsUtils/sendBeacon/index.ts | Allows Reverb “error” events and forwards error label payload. |
| src/app/lib/analyticsUtils/sendBeacon/index.test.ts | Adds a test ensuring the error label is forwarded to Reverb. |
| src/app/hooks/useUASButton/index.ts | Tracks UAS failures (fetch-status, metadata-sync, save/remove) and filters offline actions. |
| src/app/hooks/useUASButton/index.test.tsx | Adds tests for offline handling and UAS error tracking integration. |
| src/app/hooks/useErrorTracking/index.tsx | New hook to translate errors into a structured analytics “error” event. |
| src/app/hooks/useErrorTracking/index.test.tsx | Tests tracking context wiring, UasError detail extraction, and offline filtering. |
| src/app/components/ATIAnalytics/types.ts | Updates Reverb event typing to include error events/labels. |
| src/app/components/ATIAnalytics/atiUrl/index.ts | Adds buildErrorEventModel to generate the new error beacon payload. |
| src/app/components/ATIAnalytics/atiUrl/index.client.test.ts | Adds tests for buildErrorEventModel. |
Review details
- Files reviewed: 14/14 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ng-using-use-custom-event-tracker-for-idcta-and-uas-functionality
shayneahchoon
approved these changes
Sep 10, 2026
vdeksne
approved these changes
Sep 10, 2026
jinidev
reviewed
Sep 10, 2026
jinidev
reviewed
Sep 10, 2026
jinidev
reviewed
Sep 10, 2026
jinidev
approved these changes
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves JIRA: https://bbc.atlassian.net/browse/WS-3212
Summary
This PR introduces a new client-side “error” analytics beacon (Piano/Reverb) and wires it into the UAS save/remove flow so client-side failures can be tracked with richer diagnostic context (status + service error code/message when available).
Changes:
Add a new
buildErrorEventModel+sendErrorEventutility to send standalone Reverb “error” beacons.Extend UAS error handling to capture error bodies (JSON
{ key, message }or plain text) and expose them viaUasError.Add
useErrorTrackingand integrate it intouseUASButton(including offline filtering) while updating Reverb beacon types to support the new error event.Piano dashboard
Code changes
buildErrorEventModelanduseErrorTrackingTesting
More details re. Charles Proxy
Useful Links