Fixed
Status Update
Comments
da...@google.com <da...@google.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug: b/264018028
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
https://android-review.googlesource.com/2373449
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug:
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
el...@google.com <el...@google.com>
ma...@justpinch.com <ma...@justpinch.com> #4
deleted
da...@google.com <da...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.tv:tv-material:1.0.0-alpha04
Description
Component used:androidx.room:room-*
Version used: 2.3.0, 2.4.0-alpha02
Devices/Android versions reproduced on: N/A -> code-gen error (kapt)
The documentation on states:
@Transaction
But unless I'm misunderstanding what this is trying to communicate, reality seems to be different.
Given the following dao:
Although implementations are generated, errors are thrown for the
@Transaction
annotated functions returningLiveData
andFlowable
:This seems to contradict the earlier statement from the documentation on
@Transaction
? Is there another way to use@Transaction
with a deferred/async return type?What's also interesting is that the
@Transaction
annotated function returning aFlow
does not yield any errors. Isn'tFlow
also a deferred/async return type? Does this mean that Room can in fact guarantee that all queries in the method are performed on the same thread? If so, how?The generated code looks like this:
This function is no longer deferred, because the transactional operations involve blocking I/O, and there are assertions in place that will fail if this is called from the main thread. And even if we were to make this function suspendable (we would then have a suspendable function returning a Flow?🤨), it would still not be main-safe.
In conclusion, I suspect:
@Transaction
is no longer accurate?@Transaction
annotation returning aFlow
should also yield a code-gen error?