Fixed
Status Update
Comments
su...@google.com <su...@google.com> #2
Project: platform/frameworks/support
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
https://android-review.googlesource.com/1123258
https://goto.google.com/android-sha1/b90079595f33f58fece04026a97faa0d243acdb1
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
[Deleted User] <[Deleted User]> #3
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
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 ( b/140759491 ).
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
https://android-review.googlesource.com/1288456
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
su...@google.com <su...@google.com> #5
A further fix should be available in alpha09.
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit fd35a469cabd33509e1d90c57561e33be03a0dd8
Author: Sumir Kataria <sumir@google.com>
Date: Tue Sep 18 13:11:51 2018
Prevent potential foreign key constraints in AlarmMgr.
This change is an addition to the one for JobScheduler:
https://android-review.googlesource.com/c/platform/frameworks/support/+/758783
Also, this change fixes a potential issue where handleScheduleWorkIntent
was not being executed inside a transaction as it should.
Bug: 114705286
Test: Added and ran tests.
Change-Id: Ica1e54e3e9d43d52e11731f3a5727433aac0f622
M work/workmanager/src/androidTest/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcherTest.java
M work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/CommandHandler.java
https://android-review.googlesource.com/760504
https://goto.google.com/android-sha1/fd35a469cabd33509e1d90c57561e33be03a0dd8
Branch: androidx-master-dev
commit fd35a469cabd33509e1d90c57561e33be03a0dd8
Author: Sumir Kataria <sumir@google.com>
Date: Tue Sep 18 13:11:51 2018
Prevent potential foreign key constraints in AlarmMgr.
This change is an addition to the one for JobScheduler:
Also, this change fixes a potential issue where handleScheduleWorkIntent
was not being executed inside a transaction as it should.
Bug: 114705286
Test: Added and ran tests.
Change-Id: Ica1e54e3e9d43d52e11731f3a5727433aac0f622
M work/workmanager/src/androidTest/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcherTest.java
M work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/CommandHandler.java
su...@google.com <su...@google.com> #7
Fixed in alpha09.
ak...@gmail.com <ak...@gmail.com> #8
It is happening again on 2.7.1 version
`implementation 'androidx.work:work-runtime-ktx:2.7.1'
`implementation 'androidx.work:work-runtime-ktx:2.7.1'
mw...@gmail.com <mw...@gmail.com> #9
We have following gradle version, it is impacted heavily
Gradle: androidx.work:work-runtime:2.7.0@aar
Gradle: androidx.work:work-runtime-ktx:2.7.0@aar
Gradle: androidx.work:work-rxjava2:2.7.0@aar
Attachment: Impacted Users and session in a week
This issue has 16,025,903 crash events affecting 55,770 users
Stack Trace:
Fatal Exception: android.database.sqlite.SQLiteConstraintException: FOREIGN KEY constraint failed (code 787 SQLITE_CONSTRAINT_FOREIGNKEY)
at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(SQLiteConnection.java)
at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:890)
at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:756)
at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:66)
at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1920)
at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1841)
at androidx.sqlite.db.framework.FrameworkSQLiteDatabase.execSQL(FrameworkSQLiteDatabase.java:265)
at androidx.work.impl.WorkDatabase$2.onOpen(WorkDatabase.java:167)
at androidx.work.impl.WorkDatabase_Impl$1.onOpen(WorkDatabase_Impl.java:113)
at androidx.room.RoomOpenHelper.onOpen(RoomOpenHelper.java:136)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.onOpen(FrameworkSQLiteOpenHelper.java:201)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:427)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:316)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase(FrameworkSQLiteOpenHelper.java:151)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase(FrameworkSQLiteOpenHelper.java:112)
at androidx.room.RoomDatabase.inTransaction(RoomDatabase.java:706)
at androidx.room.RoomDatabase.assertNotSuspendingTransaction(RoomDatabase.java:483)
at androidx.work.impl.model.WorkTagDao_Impl.getTagsForWorkSpecId(WorkTagDao_Impl.java:93)
at androidx.work.impl.WorkerWrapper.run(WorkerWrapper.java:135)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Gradle: androidx.work:work-runtime:2.7.0@aar
Gradle: androidx.work:work-runtime-ktx:2.7.0@aar
Gradle: androidx.work:work-rxjava2:2.7.0@aar
Attachment: Impacted Users and session in a week
This issue has 16,025,903 crash events affecting 55,770 users
Stack Trace:
Fatal Exception: android.database.sqlite.SQLiteConstraintException: FOREIGN KEY constraint failed (code 787 SQLITE_CONSTRAINT_FOREIGNKEY)
at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(SQLiteConnection.java)
at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:890)
at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:756)
at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:66)
at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1920)
at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1841)
at androidx.sqlite.db.framework.FrameworkSQLiteDatabase.execSQL(FrameworkSQLiteDatabase.java:265)
at androidx.work.impl.WorkDatabase$2.onOpen(WorkDatabase.java:167)
at androidx.work.impl.WorkDatabase_Impl$1.onOpen(WorkDatabase_Impl.java:113)
at androidx.room.RoomOpenHelper.onOpen(RoomOpenHelper.java:136)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.onOpen(FrameworkSQLiteOpenHelper.java:201)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:427)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:316)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase(FrameworkSQLiteOpenHelper.java:151)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase(FrameworkSQLiteOpenHelper.java:112)
at androidx.room.RoomDatabase.inTransaction(RoomDatabase.java:706)
at androidx.room.RoomDatabase.assertNotSuspendingTransaction(RoomDatabase.java:483)
at androidx.work.impl.model.WorkTagDao_Impl.getTagsForWorkSpecId(WorkTagDao_Impl.java:93)
at androidx.work.impl.WorkerWrapper.run(WorkerWrapper.java:135)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
xu...@gmail.com <xu...@gmail.com> #10
i met issue too: FOREIGN KEY constraint failed (code 787 SQLITE_CONSTRAINT_FOREIGNKEY)
Description
Version used:1.0.0-alpha08
Devices reproduced on:Xiaomi, Motorola, Samsung, Oppo, etc
Android versions reproduced on:6,7,8,9
We are facing this crash with 2 stack traces :
android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId (SQLiteConnection.java)
android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId (SQLiteConnection.java:812)
android.database.sqlite.SQLiteSession.executeForLastInsertedRowId (SQLiteSession.java:788)
android.database.sqlite.SQLiteStatement.executeInsert (SQLiteStatement.java:86)
android.arch.persistence.db.framework.FrameworkSQLiteStatement.executeInsert (SourceFile:50)
android.arch.persistence.room.EntityInsertionAdapter.bind (SourceFile:64)
androidx.work.impl.model.SystemIdInfoDao_Impl.insertSystemIdInfo (SourceFile:52)
androidx.work.impl.background.systemjob.SystemJobScheduler.schedule (SourceFile:92)
androidx.work.impl.Schedulers.schedule (SourceFile:99)
androidx.work.impl.utils.EnqueueRunnable.scheduleWorkInBackground (SourceFile:114)
androidx.work.impl.utils.EnqueueRunnable.run (SourceFile:86)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1113)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588)
java.lang.Thread.run (Thread.java:818)
android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId (SQLiteConnection.java)
android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId (SQLiteConnection.java:812)
android.database.sqlite.SQLiteSession.executeForLastInsertedRowId (SQLiteSession.java:788)
android.database.sqlite.SQLiteStatement.executeInsert (SQLiteStatement.java:86)
android.arch.persistence.db.framework.FrameworkSQLiteStatement.executeInsert (SourceFile:50)
android.arch.persistence.room.EntityInsertionAdapter.bind (SourceFile:64)
androidx.work.impl.model.SystemIdInfoDao_Impl.insertSystemIdInfo (SourceFile:52)
androidx.work.impl.background.systemjob.SystemJobScheduler.schedule (SourceFile:92)
androidx.work.impl.Schedulers.schedule (SourceFile:99)
androidx.work.impl.WorkManagerImpl.rescheduleEligibleWork (SourceFile:555)
androidx.work.impl.utils.ForceStopRunnable.run (SourceFile:74)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1113)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588)
java.lang.Thread.run (Thread.java:818)
Here is the fabrics link for this crash: