Fixed
Status Update
Comments
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 7c6dacebb5dd68ddeec73e494c2d3b940db33b41
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Dec 02 16:04:03 2021
Prevent NavHost from compose the wrong entry
Treating the visible lists like sets to ensure that they never can
duplicate any entries and allow NavHost to choose the wrong entry to
compose.
We are opting to only treat it like a Set instead of making it into one
to ensure we will keep the snapshot funcationality of
mutableStateListOf().
RelNote: "Fixed potential crashed caused by fast switching between the
start destination and another destination using bottom nav menu items."
Test: all tests pass
Bug: 208887901
Change-Id: Ic89766e6f0527af0cd3e793643c38ea9e1f2a272
M navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHost.kt
https://android-review.googlesource.com/1909652
Branch: androidx-main
commit 7c6dacebb5dd68ddeec73e494c2d3b940db33b41
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Dec 02 16:04:03 2021
Prevent NavHost from compose the wrong entry
Treating the visible lists like sets to ensure that they never can
duplicate any entries and allow NavHost to choose the wrong entry to
compose.
We are opting to only treat it like a Set instead of making it into one
to ensure we will keep the snapshot funcationality of
mutableStateListOf().
RelNote: "Fixed potential crashed caused by fast switching between the
start destination and another destination using bottom nav menu items."
Test: all tests pass
Bug: 208887901
Change-Id: Ic89766e6f0527af0cd3e793643c38ea9e1f2a272
M navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHost.kt
jb...@google.com <jb...@google.com> #3
This has been fixed internally and will be available in the Navigation 2.4.0-rc01
release.
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-safe-args-generator:2.9.0-alpha06
Description
Component used: Navigation
Problem:
Given a navigation graph, when I programatically route to destinations, one option to do so is to use the Actions api:
Everyone makes mistakes, and sometimes the
navigate
call is omitted. This can lead to hard to spot bugs.Solution:
There are two possible solutions here. One is to simply apply
@CheckResult
to the action method in the generated code output. This is the simplest, and most straightforward. It is also probably the right move, given that if you create an action via this API, it's a bit weird if you then never use it.We can take this a step further, and add a custom lint rule that checks that the action is actually utilized, the same way in which we check that, for example, we commit fragment transactions.