Skip to content
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

Browser desyncs state on any browser navigation #287

Open
mathmods opened this issue Feb 8, 2022 · 0 comments
Open

Browser desyncs state on any browser navigation #287

mathmods opened this issue Feb 8, 2022 · 0 comments
Labels
bug Something isn't working as intended help wanted Extra attention is needed low priority Tasks that we don't have the resources or shouldn't tackle in priority

Comments

@mathmods
Copy link
Contributor

mathmods commented Feb 8, 2022

Describe the bug
Using the back or forward navigation button in the browser will desync the state.
If you want to go back, the history gets sent 2 steps back.
If you want to go forward, you get sent back.

To Reproduce
Steps to reproduce the bug:

  1. Go to the staging site
  2. Enter any lesson with more than 1 practice (for example lesson 6)
  3. Enter any practice
  4. Navigate to any new practice
  5. Use the browser back button (and notice the history getting popped twice)
  6. Use the browser forward button (and get sent back)

Expected behavior
The back button will only pop history once.
The forward button will either do nothing or navigate the user to the requested resource.

Information about your device (please complete the following information):

  • Operating System: Chrome (latest stable)
  • Browser: Windows

Additional context
Discovered while testing #277. Apparently the current setup is that on any popstate the browser will navigate back, but this also triggers a popstate from the navigate back function. (Thus making the browser think it's gone back another time.)
Popstate also triggers on any change in the link, even when it's supposed to go forward. Thus activating the navigate back function.

@mathmods mathmods added the bug Something isn't working as intended label Feb 8, 2022
@mathmods mathmods changed the title Browser desyncs state on any in-built navigation Browser desyncs state on any browser navigation Feb 8, 2022
@NathanLovato NathanLovato added the help wanted Extra attention is needed label Feb 16, 2022
@NathanLovato NathanLovato added the low priority Tasks that we don't have the resources or shouldn't tackle in priority label Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended help wanted Extra attention is needed low priority Tasks that we don't have the resources or shouldn't tackle in priority
Projects
None yet
Development

No branches or pull requests

2 participants