Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit d8ae257b1d34561fa4838556c41050b79033a18a
Author: Clara Fok <clarafok@google.com>
Date: Wed Feb 28 12:47:31 2024
DeepLink query params now allow {argName} values for String types
For arguments of NavType<String>, arg values that are in the form of curly braces around argument name is now allowed as valid values. For all other types, this value is still considered as invalid (or absent of argument value).
Internal tests have been updated to reflect this new change. To be precise:
1. NavControllerRouteTest.kt - tests that are setup with absence of value were passing values of {argName} with StringType. Since this is no longer processed as absence of value, StringType has been changed to IntArrayType.
2. NavDeepLinkTest - likewise as NavControllerRouteTest.kt, with additional new test to assert that {argName} is invalid for non-String types.
Test: ./gradlew navigation:navigation-common:cC
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 327274038
Relnote: "Query parameters in DeepLink now allows values in the form of curly braces around argument name (i.e. {argName}) as valid values for string-based NavTypes. This contrasts with before where such a value would be considered invalid (or absence of value) for all types."
Change-Id: I183028e2f77d63158a9a567c43da016722397cb8
M navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
M navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
https://android-review.googlesource.com/2982559
Branch: androidx-main
commit d8ae257b1d34561fa4838556c41050b79033a18a
Author: Clara Fok <clarafok@google.com>
Date: Wed Feb 28 12:47:31 2024
DeepLink query params now allow {argName} values for String types
For arguments of NavType<String>, arg values that are in the form of curly braces around argument name is now allowed as valid values. For all other types, this value is still considered as invalid (or absent of argument value).
Internal tests have been updated to reflect this new change. To be precise:
1. NavControllerRouteTest.kt - tests that are setup with absence of value were passing values of {argName} with StringType. Since this is no longer processed as absence of value, StringType has been changed to IntArrayType.
2. NavDeepLinkTest - likewise as NavControllerRouteTest.kt, with additional new test to assert that {argName} is invalid for non-String types.
Test: ./gradlew navigation:navigation-common:cC
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 327274038
Relnote: "Query parameters in DeepLink now allows values in the form of curly braces around argument name (i.e. {argName}) as valid values for string-based NavTypes. This contrasts with before where such a value would be considered invalid (or absence of value) for all types."
Change-Id: I183028e2f77d63158a9a567c43da016722397cb8
M navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
M navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
cl...@google.com <cl...@google.com> #3
Fixed internally and available in navigation 2.8.0-alpha05
pr...@google.com <pr...@google.com> #4
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-common:2.8.0-alpha05
androidx.navigation:navigation-runtime:2.8.0-alpha05
Description
When parsing NavDeepLink, we consider a NavType.StringType value that is identical to the argument name as a valid value. For example:
The argument
pathArg
will contain value of{pathArg}
. This should also apply to query arguments.