Repository navigation
web/flows: fix race condition in continuous login and support source stages in authentication flows (cherry-pick #23049 to version-2026.2) - #23557
Conversation
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…stages in authentication flows (cherry-pick #23049 to version-2026.2) Backport of #23049, rebuilt from the final merged state on main (4296064) rather than the early PR revision the previous attempt was based on. Adaptations for version-2026.2: - FlowMultitabController logic ported inline into FlowExecutor's ak-multitab-continue listener (2026.2 lacks the controllers refactor), keeping the blank://blank app-hiding guard still used in 2026.2. - test_auth_n_request setUp creates the test-app Application (main already had it). - Generated API clients are produced from schema.yml at release time; only the schema contract is committed (2026.2 tracks no client-*). Co-Authored-By: Playpen Agent <[email protected]>
dbefdc7 to
f24f1df
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## version-2026.2 #23557 +/- ##
==================================================
+ Coverage 93.45% 93.47% +0.01%
==================================================
Files 985 985
Lines 55900 55956 +56
==================================================
+ Hits 52242 52304 +62
+ Misses 3658 3652 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-f24f1df8a7419326591792d1f51ccdf9b0eb8225
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-f24f1df8a7419326591792d1f51ccdf9b0eb8225Afterwards, run the upgrade commands from the latest release notes. |
kensternberg-authentik
left a comment
There was a problem hiding this comment.
Mixed feelings... This seems esoteric enough that I have trouble following along, but the basic code makes sense. The window seems a little small (20ms) for something that's looking for multiple tabs; in a heavily-loaded system (like my little toy Surface 1), chrome can bog down badly and getting a response back in that short a period seems unlikely.
Also, there's a for/await loop here that's gathering information from a bunch of tabs; the order doesn't seem to matter, so why isn't this "launch a bunch of promises and gather them with allSettled()?" If they're loaded tabs, the user could be waiting on a frozen screen as each one runs or times out (15 seconds each!).
I'm not going to block approval; this is a fair backport. I just want it to be one that doesn't generate service calls.
| this.dispatchMessage({ | ||
| type: BroadcastMessageType.Discover, | ||
| sender: TabID.shared.current, | ||
| }); |
There was a problem hiding this comment.
Immediately after this is a delay of 20ms to await the transfer of discovered Tabs. If a tab is busy in its main thread, it could easily miss this window. Is 20ms really long enough?
| Broadcast.shared.resumeTab(tab, resumeID); | ||
|
|
||
| await done.promise; | ||
| await done; |
There was a problem hiding this comment.
Okay, dumb question. for loops with an await are a code smell. Why isn't this an array fed to Promise.allSettled()? You're waiting on a per tab basis, serially, sequentially. That seems... wrong, somehow. Maybe I don't understand the problem.
This PR is a backport of #23049 to
version-2026.2, rebuilt from the merged commit onmain(42960643) rather than the earlier PR revision the previous backport branch used in #23060Adaptations for version-2026.2
version-2026.2lacks the flow controllers refactor (web/flow: extract lifecycle events peripheral to stage management into their own controllers #20898), soFlowMultitabController's logic is ported inline intoFlowExecutor'sak-multitab-continuelistener. It uses the merged design's same-origin suppress/leave logic fornext(the SP-initiated SAML resume fix) but keeps theblank://blankapp-hiding guard, which 2026.2 still relies on (the dashboard-hide option only landed in 2026.5).broadcast.ts,orchestrator.ts,TabID.ts, newevents.ts/messages.ts) are identical tomain.RedirectStage.tscarries only the web/flows: fix race condition in continuous login and support source stages in authentication flows #23049 changes (final_redirecthandling), without unrelatedmaindrift.test_auth_n_request.pysetUpcreates thetest-appApplication (already present onmain).schema.ymlat release time; 2026.2 tracks none of them, so only the schema contract is committed.