-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Deep Links are appended instead of replacing the route #654
Comments
same issue here i used this version and it worked for me beamer: 1.5.6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note
Disclaimer: As my time is currently severely limited, this report might be lacking some nicer or more appropriate phrasings and is likely not as polished as I would like it to be. I am sorry for this. This is also the reason why I am, at least at the moment, not able to provide a fix by myself and open a pull request.
Describe the bug
In bfe7ce3 all
location
usages were replaced withuri.toString()
calls.However, this broke the deep linking feature and possibly even more.
Now when triggering a deep link the link gets appended to the root URI (
/
), which results in weird and incorrect route URLs.Example:
/
.example:https://app/settings
/setttings
./example:https://app/settings
.This happens because the absolute path check is broken in at least
Utils#maybeAppend
, however, a quick search through the code found more possible breakages due to the above-mentioned replacement action.Beamer version: (e.g.
v0.14.1
,master
, ...)v1.6.0
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Correctly checking for an absolute URI, so the deep link isn't incorrectly appended.
Device (please complete the following information):
Not applicable.
Additional context
The following code has been changed to just check if the whole URI starts with a slash instead of, as before, just the location (aka. the
path
part of a URI).As the old check only considered the
path
part, simply switching touri.toString()
broke it for every URI that has ascheme
and/orauthority
part (which is now possible due to the new type):beamer/package/lib/src/utils.dart
Lines 250 to 264 in bfe7ce3
Therefore, the new absolute URI (
example:https://app/settings
) is simply appended to the existing URI (/
)Possible Fix
This seems to be a usable fix for this exact method (there are potentially more needing a similar fix) that allows deep links to work again, at the very least, in my short use case test:
Note: This would still be mishandling URIs that are not absolute but contain a
scheme
orauthority
, however, I am not sure if such a URI would be even valid!The text was updated successfully, but these errors were encountered: