Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Component used: Navigation
Version used: Any
Devices/Android versions reproduced on: Any
There is a deep link we have historically had in the app with this structure:
We want to make this work with a type-safe destination which has this signature
And with the deep link defined as:
Right now when trying to deep link to for example "https://baseurl.com/sometopic?id=asd " we do not get a match with this destination.
Trying to understand why, I run generateRoutePattern on the data class, and figured that it expects the deep link to look like this " https://baseurl.com/sometopic/{id} " instead, since it's not nullable.
Now while this makes sense regarding the
id
not being optional, there is no path forward for us to be able to support the existing deep link while using the type-safe APIs without having to resort to changing our destination data class to have a default parameter:This fixes the deep link, but breaks the semantics of our data class definition, as it now allows for easier mistakes on our end when constructing an instance of this class if we now forget to pass an ID, since the IDE will no longer be warning us about it.
I feel like there is room here for the navigation library to match this destination in the first place, since the
id
is in fact present in this deep link, or to provide us some way to be able to keep supporting our already existing deep link while also allowing us to move to the type-safe navigation APIs