You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
View the website, url for page A, use replace_with_state to set the state for this page, this created state id=0
Go to page B with push_with_state, this created state id=1
Reload the current page B, this will again "use replace_with_state to set the state for this page, this created state id=0"
Go back, this will go the the url of page A, JS will return state id 0 and thus state 0 is used (which was created for page B)
Expected Behavior
There should be no state found when going back.
Additional Context
It can be "fixed" by starting the id (crates/history/src/utils.rs:7) not at 0 but at a more or less random point.
One alternative to an actual random number would be to use window.performance.now().hash().
But since MemoryHistory also uses the id system it may have to be split to not bring web-sys dependencied into MemoryHistory.
I can try to write a PR for it, if this is something that is wanted.
The text was updated successfully, but these errors were encountered:
Describe the Bug
It's possible that a wrong state is loaded.
Steps to Reproduce
replace_with_state
to set the state for this page, this created state id=0push_with_state
, this created state id=1replace_with_state
to set the state for this page, this created state id=0"Expected Behavior
There should be no state found when going back.
Additional Context
It can be "fixed" by starting the id (crates/history/src/utils.rs:7) not at 0 but at a more or less random point.
One alternative to an actual random number would be to use window.performance.now().hash().
But since MemoryHistory also uses the id system it may have to be split to not bring web-sys dependencied into MemoryHistory.
I can try to write a PR for it, if this is something that is wanted.
The text was updated successfully, but these errors were encountered: