Skip to content

fix: login -> close tab -> open new tab -> logout [error]: Redux store data not available#49

Merged
Alessandro100 merged 3 commits intomainfrom
fix/login-state-persist
Mar 4, 2026
Merged

fix: login -> close tab -> open new tab -> logout [error]: Redux store data not available#49
Alessandro100 merged 3 commits intomainfrom
fix/login-state-persist

Conversation

@Alessandro100
Copy link
Contributor

@Alessandro100 Alessandro100 commented Mar 4, 2026

Summary:

BUG:

  • User logs in -> user closes the browser tab -> user opens a new tab (ex: landing) -> user goes to logout [ERROR STATE]

You can test this on: https://beta.mobilitydatabase.org/

Reason: When the user opens the new tab on a non-legacy page, the redux store data is not initialized. So when the user goes to logout (from the header) the logout action clears nothing because the store isn't initialized

Fix: Initialize the redux store data from all pages without waiting on it to finish hydrating. The non-legacy pages will initialize the store data but it wont be ready until the client rehydrates it (potential bug - but low odds of it happening).

Also added some small fixes for best practices (image) and lighthouse url fix

Expected behavior:

User logs in -> user closes the browser tab -> user opens a new tab (any page) -> user goes to logout -> user is able to log back in

Testing tips:

Attempt the expected behaviour

Future
With SSR (stateless by design) handling Redux state feels like we are fighting against the stateless philosophy. Evaluate a potential redux replacement of authentication state

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with yarn test to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@Alessandro100 Alessandro100 added the bug Something isn't working label Mar 4, 2026
@vercel
Copy link

vercel bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mobilitydatabase-web Ready Ready Preview, Comment Mar 4, 2026 2:11pm

Request Review

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

*Lighthouse ran on https://mobilitydatabase-ratapsrhr-mobility-data.vercel.app/ * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 97 🟢 96 🟢 100 🟢 100

*Lighthouse ran on https://mobilitydatabase-ratapsrhr-mobility-data.vercel.app/feeds * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 91 🟠 87 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-ratapsrhr-mobility-data.vercel.app/feeds/gtfs/mdb-2126 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🔴 47 🟢 94 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-ratapsrhr-mobility-data.vercel.app/feeds/gtfs_rt/mdb-2585 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 99 🟠 83 🟢 100 🟢 100

*Lighthouse ran on https://mobilitydatabase-ratapsrhr-mobility-data.vercel.app/feeds/gbfs/gbfs-flamingo_porirua * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 92 🟢 94 🟢 96 🟢 100

@Alessandro100 Alessandro100 merged commit 0baab3e into main Mar 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants