Repository navigation
web/flow: revert locale-driven flow re-request from FlowExecutor (cherry-pick #24050 to version-2026.5) - #24068
Merged
Conversation
) Back out the `LOCALE_STATUS_EVENT` listener that #23007 added to `FlowExecutor`. The label-formatting half of that PR (`format.ts`, `ak-locale-select.ts`, the `activeLocaleTag`-keyed `repeat`, and the mixin `@remarks`) stays; only the executor-side re-request goes. The operator's report was that the flow executor isn't handling locale events well. Four failure modes make that report reproducible. First, on mount we get two concurrent `flowsExecutorGet` calls. `firstUpdated` already kicks off `refresh()` unconditionally, and `LOCALE_STATUS_EVENT` fires as soon as `@lit/localize` resolves the initial locale, which on the cached/default path is the same tick. Both GETs land in the server's dispatch loop; each one calls `plan.next(self.request)` and writes back to `request.session[SESSION_KEY_PLAN]`. Django sessions aren't transactional across concurrent requests, so the second write can clobber the first. Second, the promise chain in `firstUpdated` around line 253 breaks. `refresh().then(() => dispatchEvent(new AKFlowAdvanceEvent()))` resolves against the challenge *its* GET returned, but a second refresh can overwrite `this.challenge` in between, so listeners that read `flowExecutor.challenge` on advance see a stale stage. Third, every user-initiated locale change destroys stage state. Once the executor is mounted, flipping the locale selector fires `LOCALE_STATUS_EVENT`, which calls `refresh()`, which replaces `this.challenge`. The `guard([challenge])` in the render tears down the whole stage subtree and rebuilds it, dropping typed input on password / email / identification stages and cancelling in-flight captcha and WebAuthn widgets. Fourth, auto-advance stages (redirect, consent auto-confirm, source continuation) resolve on GET, so two concurrent GETs advance the plan twice and skip a stage. `CaptchaStage` already shows the right pattern for this: the stage owns its own `LOCALE_STATUS_EVENT` listener and re-runs the locale-dependent piece in place, without tearing down its containing view. Whoever picks this up next should either re-render the server-rendered label subtrees in place, or fetch the label strings through a locale-aware endpoint, rather than re-requesting the whole flow. Re-opens the server-side-label half of #22954. Co-authored-by: Agent (authentik-m-web-flow-wide-brief-cherry) <[email protected]> Co-authored-by: Jens L. <[email protected]>
BeryJu
approved these changes
Jul 15, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## version-2026.5 #24068 +/- ##
==================================================
- Coverage 93.30% 93.28% -0.02%
==================================================
Files 1037 1037
Lines 60561 60561
Branches 400 400
==================================================
- Hits 56504 56496 -8
- Misses 4057 4065 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
1 task
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.
Cherry-pick of #24050 to
version-2026.5branch.Original PR: #24050
Original Author: @GirlBossRush
Cherry-picked commit: dff7424