Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
I see that this issue was assigned. I can create Pull Request if need.
al...@mercari.com <al...@mercari.com> #3
Feel free to do so and we will review.
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #5
I think your PR also fixes our problem: we have links like
.../search/
.../search?documentId=123
.../search?folder=123
And each should be redirected to different navigation destinations. Currently they all redirect to one page, and sometimes crash.
Description
Component used: Navigation Version used: 2.4.0-beta02
Query parameters are being decoded twice,
The first one viahttps://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt;l=181
Uri.getQueryParameter
call in:and for the second time in :https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt;l=193
This results to wrong incorrect final decoded value provided to the
SavedStateHandle
.This leads to encoded special characters such as
%
to be decoded incorrectly. For example, the raw value being%555
gets encoded correctly to%25555
, Then on the first decode it gets correctly decoded back into%555
, but due to decoding an already decoded string, the final decoded argument value becomesU5
.It is easily replicable with common use case. For example, for routes with search query like
search?query=%555
, the argument transforms intoU5
and is searched instead.