<@UJBPFB3SN> I hope you don't mind me asking you t...
# compose-destinations
r
@Ian Lake I hope you don't mind me asking you this here. I was testing something with Compose Navigation and it turns out, something like what I have in below picture, will make it so
"profile"
composable that belongs to
"graphB"
will never be used. (Notice that
"profile"
route is used in two
composable
calls) Question is: couldn't compose navigation check for route uniqueness and maybe throw an exception? I mean, this seems like a bug that the developer might not notice. One of these Composables will never be used. I will open an issue if you agree, but I wanted to check in with you first since maybe I'm missing something. (uploading picture since the syntax highlighting helps here more than being able to copy code from it)
i
Keep in mind that each destination could still have unique deep links that would actually let you get to the second one
And I believe there's an open issue for making the route finding start looking from where you are, rather than from the root, which would mean it could be used
r
Hmm meaning if you are already on graphB then navigating to profile would get you to graphB’s profile?
i
Correct
r
That’s what I was expecting when I put this together. But still if you are in neither one it would feel a bit random. Of course at that point maybe the root doesn’t even know about profile so it would only navigate to one of the nested graphs
i
It isn't random at all, it is in the order they are declared
r
The deep links thing is also a good point. But I guess we could check for same route and same deep links then, right?
It isn't random at all, it is in the order they are declared
are you sure? Coz I specifically tried that 😅 Let me make sure, but I believe I did. Anyway, I imagine it’s not random literally, but it may feel like that if users don’t know what’s the logic behind that decision
i
Deep links are lazily evaluated, so you'd be slowing down the entire system if you were to check them all at creation time
r
I see. That makes sense. Maybe in compose destinations I can do that at compile time then 😜
I’ll think about it. Thank you @Ian Lake it was really helpful!
i
If you can't find the issue about route ordering preferring the graph you are already on, please file a new one and I can dup it if I can find the other
👍 1
r
Deal, I’ll search for it.
Created a new one: https://issuetracker.google.com/issues/319671253 Hopefully I made it clear enough 😅
i
Yep, looks good to me. If I do find the one that was already filed, I'll mark it as a duplicate. Otherwise, we'll just use this one. Thanks for filing the issue!
👍 1