fix: update browser URL on Routefly.pop to previous route & do not parse hex url query params as number#34
Open
RyanHolanda wants to merge 2 commits into
Open
fix: update browser URL on Routefly.pop to previous route & do not parse hex url query params as number#34RyanHolanda wants to merge 2 commits into
RyanHolanda wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While using Routefly on Flutter Web, Routefly.pop did not update the browser URL to the previous route, causing history/refresh inconsistencies. Additionally, hex-looking URL query params (e.g., Ethereum addresses like “0x4e68ccd3e89f51c3074ca5072bbac773960dfa36”) were being parsed as numbers when accessed via Routefly.query[].
This PR fixes:
• Browser URL on pop: the router sets the URL to the last non-push configuration (calls setNewRoutePath on pop).
• Root path filtering: PushNavigate filters out the root path ("/") when rebuilding across routes to prevent "/" from becoming the last route accidentally.
• Query parsing: do not parse hex-like query params (values starting with "0x") as numbers, keep them as strings to preserve Ethereum addresses and similar identifiers.
Impact:
• Correct browser history behavior on pop.
• Prevents stale root entries in the navigation stack.
• Preserves hex query params (e.g., Ethereum addresses) as strings, preventing unintended numeric parsing.
• Tested on Flutter Web (browser back/refresh now reflect the previous route; hex queries remain intact).
• No breaking changes to mobile navigation.