Status Update
Comments
yb...@google.com <yb...@google.com> #2
Information redacted by Android Beta Feedback.
[Deleted User] <[Deleted User]> #3
Thank you for reporting this issue. We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
yb...@google.com <yb...@google.com> #4
[Deleted User] <[Deleted User]> #5
yb...@google.com <yb...@google.com> #6
Thank you for the report.
Please capture the bugreport by enabling modem logs.
[How to enable "Verbose Vendor Logging"]
Menu->settings->about phone -> build number -> keep click the "build number" till it shows "now you are a developer"
Go to Settings -> system -> developer options
Scroll down and find "USB debugging". Enable it "Enable Verbose Vendor Logging" Enable it too
Whenever issue observed, please do:
Settings -> System -> Developer Options -> Click "Bug report".
It will take few minutes to generate A bugreport. Please save and share it.
Note: Please upload the bug report to google drive and share the folder to
ap...@google.com <ap...@google.com> #7
starting. (At around 9:05 AEDST)
On Mon, 22 July 2024, 8:52 am , <buganizer-system@google.com> wrote:
Description
Version used: 2.0.0
Devices/Android versions reproduced on: N/A
In current version of room if I mark method in DAO with @Transaction, and if it uses any disposable e.g. Single, the generated code will throw main thread access exception at runtime.
I would expect one of two behaviours instead:
1. It would be ideal if room could somehow defer start/end transaction to match thread that is used on Disposable, but I can imagine that this can be not possible.
2. To get compile time warning or error that this may be not the correct way of using @Transaction with mix of asynchronous code.
Example of code:
Method in abstract DAO:
@Transaction
open fun upsert(obj: T): Single<Boolean> {
return insert(obj)
.map { true }
.onErrorResumeNext {
if (it is SQLiteConstraintException)
{ update(obj)
.map { true }
} else {
Single.error(it) }
}
.subscribeOn(Schedulers.io()) }
Generated method:
@Override
public Single<Boolean> upsert(Supplier obj) {
__db.beginTransaction();
try {
Single<Boolean> _result = super.upsert(obj);
__db.setTransactionSuccessful();
return _result;
} finally {
__db.endTransaction();
}
}