Status Update
Comments
il...@google.com <il...@google.com> #2
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
jb...@google.com <jb...@google.com> #3
sk...@gmail.com <sk...@gmail.com> #4
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
al...@gmail.com <al...@gmail.com> #5
I agree with the original post as well as ensuring the SafeArgs will be generated regardless if the sub graph is located in another file, or the same file. I've included a demo app that demonstrates the issue (main_nav_graph.xml, nested_nav_graph.xml, and OrangeFragment.kt)
il...@google.com <il...@google.com>
j....@gmail.com <j....@gmail.com> #6
xa...@gmail.com <xa...@gmail.com> #7
xa...@gmail.com <xa...@gmail.com> #8
[Deleted User] <[Deleted User]> #9
il...@google.com <il...@google.com>
be...@gmail.com <be...@gmail.com> #10
da...@khol.me <da...@khol.me> #11
The workaround to put an <argument>
directly to the root of the <navigation>
holding the destination <fragment>
does not work, at least not in version 2.3.0
.
The other workaround to copy <argument>
to the source <fragment>
's <action>
works but it defeats the purpose of SafeArgs being safe. With that approach, you potentially have to update arguments in multiple source <fragment>
s that navigate to the same destination <fragment>
. If you forget to update some of the sources, the app will compile just fine but crash at runtime. That's just UnsafeArgs.
je...@gmail.com <je...@gmail.com> #12
og...@gmail.com <og...@gmail.com> #13
mt...@parsyl.com <mt...@parsyl.com> #14
Any updates on this? This has been open for 2.5 years.
g....@gmail.com <g....@gmail.com> #15
I recently got rid of all the optional arguments and default values, replacing them with Parcelable
classes that offer the same functionality leveraging Kotlin's type system. Since there are no compile time checks for start destinations and I had to touch some of them, I quickly put together a python script that checks the arguments of the actions that have a <navigation>
as destination.
I wrote the script with my use-case in mind, so the code makes some assumptions that are not generally true. These assumption should only cause false positives, but I really didn't think this through and I could be wrong. It's not perfect and there's definitely room for improvement, but it is enough for me for now.
Please remember that many are watching this issue and not everyone here care about this script. The source code is enough to seek for help elsewhere.
nv...@gmail.com <nv...@gmail.com> #16
A major fuck up for a documented use case.
nv...@gmail.com <nv...@gmail.com> #17
From this
- Copy
<argument>
to inside the<navigation>
tag, i.e. make it a sibling of other<fragment>
- Copy
<argument>
to inside the<action>
of the start fragment. Yes normally<action>
is a self close tag, and<argument>
is for<fragment>
.
And the workaround breaks navArgs()
, because StartFragmentOfNestedGraphArgs
is not generated.
ca...@gmail.com <ca...@gmail.com> #18
We actually just had a crash in our app, fortunately detected by qa, due to using the unsafe workaround.
[Deleted User] <[Deleted User]> #19
ju...@gmail.com <ju...@gmail.com> #20
That's even more annoying since putting the arguments directly inside de <navigation> tag doesn't work. (using 2.4.1)
[Deleted User] <[Deleted User]> #21
sp...@gmail.com <sp...@gmail.com> #22
sh...@gmail.com <sh...@gmail.com> #23
[Deleted User] <[Deleted User]> #24
ap...@google.com <ap...@google.com> #25
Branch: androidx-main
commit d1e16c5abced31a3738c9686121f3a2a50c3404e
Author: Clara Fok <clarafok@google.com>
Date: Mon Feb 26 12:18:38 2024
Fix startDestination route args not processed
Filled-in arguments in the route that is passed as a NavGraph's startDestination will now be processed and stored in the bundle.
These start route arguments will overwrite default values but not the others. The priority of args is as follows:
Restored/StartDestinationArgs > Start route args > Default args
Relnote: "You can now pass arguments to NavGraph's startDestination directly in the startDestination route without relying on defaultValue. This applies to nesteded NavGraph startDestinations as well."
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 109505019
Bug: 188693139
Change-Id: I0e0b5a7c2bf2e77a8d7a46c91974509104e742a9
M navigation/navigation-common/src/main/java/androidx/navigation/NavGraphNavigator.kt
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
cl...@google.com <cl...@google.com> #26
Fixed internally, available in navigation-2.8.0-alpha05
jb...@google.com <jb...@google.com>
pr...@google.com <pr...@google.com> #27
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
Version used: 1.0.0-alpha01
Devices/Android versions reproduced on: N/A
To reproduce:
1. Construct a navigation graph with a fragment and mark it as the startDestination for the graph.
2. Construct a subgraph with another fragment that requires an argument and mark it as the startDestination for the subgraph.
3. Construct an action from the first fragment to the subgraph.
4. Use the generated classes to construct the action. Observe that the argument is not required.
5. Move the argument from the fragment to the subgraph.
4. Use the generated classes to construct the action. Observe that the argument *is* required.
I believe that in both cases, the argument should be required because the purpose of the SafeArgs generated classes is to prevent missing arguments, which would occur if the subgraph did not require the arguments of its startDestination.