Skip to content

Fix: [AEA-6210] - Include delayed information on loading page#1821

Merged
connoravo-nhs merged 38 commits intomainfrom
AEA-6210
Feb 27, 2026
Merged

Fix: [AEA-6210] - Include delayed information on loading page#1821
connoravo-nhs merged 38 commits intomainfrom
AEA-6210

Conversation

@connoravo-nhs
Copy link
Copy Markdown
Contributor

Summary

  • Routine Change

Details

Introduce an information panel that informs the user of diagnostic information and to email us, after a 15 second time delay.
Introduced persistent desktop ID to be able to identify the RUM log, in the event a user is not / never has logged in and therefore doesn't have a session ID to offer.

Orkastrated and others added 28 commits February 20, 2026 16:53
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
## Summary
- Routine Change

### Details
Adds trivy ignore for downstream dependency
## Summary
- Routine Change

### Details
RUM has a 6kb size limit to event payloads, which when hint causes the
log to be silently discarded by RUM. On users with a large number of
roles, roles with a large number of activity codes, or some combination
of the two we easily exceed this limit. This ticket splits the new
log/event into multiple smaller logs/events, including chunking the
various lists of roles into smaller groups.

---------

Co-authored-by: Connor Avery <connor.avery2@nhs.net>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket:

AEA-6210

Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
export const AuthProvider = ({children}: { children: React.ReactNode }) => {
Amplify.configure(authConfig, {ssr: false})
const [desktopId] = useLocalStorageState<string | undefined>(
"desktopId", "desktopId", crypto.randomUUID())
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default set a random UUID. Setter isn't needed as the default takes care of it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this definitely need persisting to local storage? Is there any value to this being different if they hard refresh? have multiple tabs? etc

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local storage will retain it even after clearAuthState() is ran as it's not included in the clear down. It'll persist across tabs of the same browser window/mode - that's intended. It should identify the machine as good as permanently as possible really, that way we'll know if one machine consistently has issues and attempt to work out why.

Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Information
</WarningCallout.Label>
<p>
If you keep seeing this page, email{" "}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the deal with the {" "}, you should be able to include spaces without doing anything funky

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting doesn't like a line ending in a space, which annoyingly means {" "} is needed in order to get around the line length rule for the HREF

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If thats the case i think id rather see an explicit eslint ignore for it rather than this, it better documents the issue and an ignore is fine if theres a legitimate reason to override the rule for a specific line or two

isConcurrentSession: boolean
invalidSessionCause: string | undefined
sessionId: string | undefined
desktopId: string | undefined
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know most of our users will probably be on desktop, but as a bit of future proofing for if we ever do get tablet/mobile users can we maybe give this a slightly more generic name? maybe something like clientId or something.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what scenarios do we not have a sessionId? it should be init within RUM when the app loads? If there are cases where its not present can we first check there isnt a bug/improvement around the sessionId we can make before adding another value to track

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Session ID is derived from the users auth token - We don't create it.
A user could see the loading page for a long period but not be logged in (potentially due to a former session causing a clash state) - this identifier is created client side so it's present in RUM logs, irrelevant of whether the user has a session or not.

usePageTitle(LOADING_STRINGS.PAGE_TITLE)
const [showWarningCallout, setShowWarningCallout] = useState<boolean | undefined>(undefined)

useEffect(() => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this needs its own effect, and timeout? shouldnt this and the log be happening at the same time so could be the same effect with the same timer?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could check with UX, there was a 10 second and 15 second requirement on them respectively. I did think about combining but the time was different.

connoravo-nhs and others added 6 commits February 26, 2026 10:52
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
Signed-off-by: Connor Avery <214469360+connoravo-nhs@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@connoravo-nhs connoravo-nhs merged commit 4f94221 into main Feb 27, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants