Skip to content

Implement/Add useCrossTabSessionStorage hook - #2575

Draft
JohnC-80 wants to merge 3 commits into
mainfrom
cross-tab-session-sync
Draft

Implement/Add useCrossTabSessionStorage hook#2575
JohnC-80 wants to merge 3 commits into
mainfrom
cross-tab-session-sync

Conversation

@JohnC-80

@JohnC-80 JohnC-80 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Based on comments for https://folio-org.atlassian.net/browse/STCOM-1460?focusedCommentId=276289
done to enable implementation of https://folio-org.atlassian.net/browse/UISAUTHCOM-98

We've ideanated about something that carries the ephemerality of session storage, but exists cross-tab like localstorage... this is a bit of both.

Localstorage uses a tab registry (unique id's + timestamp) per tab. Values are stored in sessionStorage on a key designated by the app.

A new tab registration (writing to localstorage) will be picked up in a session event. The catching tab will broadcast its value to sync the new tab.

Current 'live' registrations prune on a 5-second heartbeat with a stale threshold of 15-seconds. Each tab is responsible for keeping itself alive and updating this timestamp. If it's old, it gets cleaned.

Pushing this PR up in draft for discussion.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Bigtest Unit Test Results

    1 files  ± 0      1 suites  ±0   25s ⏱️ -1s
1 652 tests +15  1 644 ✅ +15  8 💤 ±0  0 ❌ ±0 
1 653 runs  +15  1 645 ✅ +15  8 💤 ±0  0 ❌ ±0 

Results for commit 58174de. ± Comparison against base commit c3c4cd2.

♻️ This comment has been updated with latest results.

@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
D Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

1 participant