feat: Share session between tabs via BroadcastChannel (M2-11052) - #2247
Closed
sricharan-varanasi wants to merge 9 commits into
Closed
feat: Share session between tabs via BroadcastChannel (M2-11052)#2247sricharan-varanasi wants to merge 9 commits into
sricharan-varanasi wants to merge 9 commits into
Conversation
17 tasks
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.
fixorfeaturebranches intodeveloporreleasebranches viaSquash and Merge(to keep clean history)📝 Description
🔗 Jira Ticket M2-11052
Follow-up to (#2246). Each tab currently runs its own keep-alive engine and knows nothing about the others, so a backgrounded tab hits its own idle deadline and logs out and under token rotation that revokes the whole family, killing the tab actually in use. A new tab also always shows the login page even when a session is live next door.
This makes tabs of the same session talk to each other over a
BroadcastChannel.Changes include:
sessionSyncmodule - one channel, and a message protocol scoped by session id (the refresh token'sfamilyclaim, falling back tojti)Behaviour is unchanged while
enableSessionKeepAliveis off - nothing is sent or received.🪤 Peer Testing
Requires the
enableSessionKeepAliveflag on, and a backend with token rotation.Sign in, then open a second tab
Expected: lands on the dashboard, no login page
Leave two tabs on the login page, sign in as User 1 in one and User 2 in the other, then open a third tab
Expected: third tab is User 2; the first two are untouched and keep working as their own user
Log out User 2, then open a new tab
Expected: new tab is User 1 - only live sessions are offered
Duplicate a tab, background the duplicate, keep working in the original past the idle timeout
Expected: neither tab logs out, and only one refresh call per cycle
Log out manually in one tab
Expected: other tabs of that session log out too
Leave every tab idle past the timeout
Expected: soft-locked login page with the email pre-filled
Turn the flag off
Expected: new tabs show the login page, no channel traffic in either direction
✏️ Notes
session-keep-alive- please review with that as the base. Will rebase ontodeveloponce feat: keep session alive on Admin ( M2 - 11001 ) #2246 merges.