Skip to content

Fix(logout): avoid an infinite loop when loading the demo apps for the first time #10769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jonathanarnault
Copy link
Contributor

Problem

The e-commerce demo was rendering a blank page with many redirects to the logout page when loading the page for the first time. After a many seconds, the login form would render due to an history.pushState abuse.

Solution

Delay the store to avoid a race condition in useLogout that would cause the CoreAdminRoutes component to rerender the LogoutOnMount component leading to an infinite loop.

How To Test

Start the e-commerce demo with the following command:

make run-demo

The login page should load fast and no warning about history.pushState should be seen in the console.

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@jonathanarnault jonathanarnault added the RFR Ready For Review label Jun 6, 2025
…could lead to unexpected behavior while logging out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Development

Successfully merging this pull request may close these issues.

1 participant