Skip to content

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

Merged
djhi merged 2 commits intomasterfrom
fix/ecommerce-demo
Jun 10, 2025
Merged

Fix(logout): avoid an infinite loop when loading the demo apps for the first time#10769
djhi merged 2 commits intomasterfrom
fix/ecommerce-demo

Conversation

@jonathanarnault
Copy link
Copy Markdown
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
Copy link
Copy Markdown
Contributor

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment too 👍

@djhi djhi merged commit 9f04aa3 into master Jun 10, 2025
15 checks passed
@djhi djhi deleted the fix/ecommerce-demo branch June 10, 2025 07:33
@djhi djhi added this to the 5.8.4 milestone Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants