fix(frontend): stop forum login from looping when Flarum auth fails#5311
Merged
Conversation
Contributor
Author
|
/request-review @Yicong-Huang |
Contributor
|
@aglinxinyuan could you PTAL? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5311 +/- ##
============================================
- Coverage 51.15% 51.09% -0.06%
+ Complexity 2413 2380 -33
============================================
Files 1054 1053 -1
Lines 40923 40514 -409
Branches 4381 4317 -64
============================================
- Hits 20933 20702 -231
+ Misses 18791 18616 -175
+ Partials 1199 1196 -3
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
General comment: can you use a test to guard this behavior? |
Signed-off-by: Matthew B. <mgball@uci.edu>
juliethecao
pushed a commit
to juliethecao/texera
that referenced
this pull request
Jun 4, 2026
…pache#5311) ### What changes were proposed in this PR? - Add an `attemptRegister` flag to `DashboardComponent.forumLogin` so a Flarum registration is attempted at most once, breaking the infinite `auth -> register -> auth` cycle that occurred when `auth()` kept failing with a non-404/500 status. - After registering, the recursive call now passes `forumLogin(false)`; if auth still fails on that pass it falls through to `displayForum = false` instead of looping. - Add an error handler to the `register()` subscription so a failed registration hides the forum rather than being silently dropped. ### Any related issues, documentation, or discussions? Closes: apache#5310 ### How was this PR tested? - Ran `yarn format:fix` (clean, no files changed). - Manually traced the control flow: auth fail (non-404/500) now does auth, register, auth, then stop, instead of recursing without bound. ### Was this PR authored or co-authored using generative AI tooling? Co-authored with Claude Opus 4.8 in compliance with ASF --------- Signed-off-by: Matthew B. <mgball@uci.edu>
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.
What changes were proposed in this PR?
attemptRegisterflag toDashboardComponent.forumLoginso a Flarum registration is attempted at most once, breaking the infiniteauth -> register -> authcycle that occurred whenauth()kept failing with a non-404/500 status.forumLogin(false); if auth still fails on that pass it falls through todisplayForum = falseinstead of looping.register()subscription so a failed registration hides the forum rather than being silently dropped.Any related issues, documentation, or discussions?
Closes: #5310
How was this PR tested?
yarn format:fix(clean, no files changed).Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.8 in compliance with ASF