Repository navigation
PlatformRouteInformationProvider does not push new entry if query par… - #130457
Conversation
…ameter is semanticsally the same
| }) : _value = initialRouteInformation; | ||
|
|
||
| static bool _equals(Uri a, Uri b) { | ||
| return a.path == b.path |
There was a problem hiding this comment.
What about all the other properties a URI can have? E.g. host, scheme, etc? If the only problem is that query params are out of order, would it make sense to remove the query params from both URIs, compare that those URIs are equal and then check the querParams separately?
There was a problem hiding this comment.
host and scheme only make sense if this is coming from the engine. I can't find a reasonable use case that the state in framework can translate into host and scheme. That means the host and scheme is always empty when framework reports uri to engine.
If we compares the host and scheme here, we would send the uri back with replace: false if the path/queryparam/fragment is the same but host and scheme are different. I think that would confuse the engine.
There was a problem hiding this comment.
we could always check for the host and scheme in the future if we identify a use case
There was a problem hiding this comment.
If we compare host and scheme now, this would only affect mobile platform as the host and scheme will only be filled out if this is a deeplink.
So we would immediately send a replace: false with the same uri but empty host and scheme to engine. Which currently is a noop for non web platform. so either way wouldn't change the behavior, but if people listen to the navigation channel for some reason, they may get some confusing result.
flutter#130457) �ameter is semanticsally the same The URI compare does not taking into account that query parameter may or may not be encoded, or the parameters' order can be different. However, they are all semantically the same. This pr makes PlatformRouteInformationProvider to take those into account when deciding whether it should push/replace the browser history entry.
…ameter is semanticsally the same
The URI compare does not taking into account that query parameter may or may not be encoded, or the parameters' order can be different. However, they are all semantically the same.
This pr makes PlatformRouteInformationProvider to take those into account when deciding whether it should push/replace the browser history entry.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.