google-research / CVD-paper-mobile-camera-example

Apache License 2.0
6 stars 4 forks source link

App Crashing while trying to re-take Video or Image resource for same patient with same Path data #15

Closed khyativyasargus closed 8 months ago

khyativyasargus commented 8 months ago

Steps to reproduce :

1)Open app and register one patient 2)After Patient registration, PPG data collection or Anemia Survey Questionnaire will be open 3)Capture PPG video once. Let thumbnail load and finish capturing. 4)Try to re-take for same question. App crashes with exception below. This is basically happening due to unique constraint for resourceFolderPath column in ResourceInfoEntity.

FATAL EXCEPTION: DefaultDispatcher-worker-5 Process: com.google.android.sensory, PID: 4499 android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: ResourceInfoEntity.resourceFolderPath (code 2067 SQLITE_CONSTRAINT_UNIQUE) at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method) at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:938) at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790) at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88) at androidx.sqlite.db.framework.FrameworkSQLiteStatement.executeInsert(FrameworkSQLiteStatement.java:51) at androidx.room.EntityInsertionAdapter.insert(EntityInsertionAdapter.java:64) at com.google.android.sensory.sensing_sdk.db.impl.dao.ResourceInfoDao_Impl$3.call(ResourceInfoDao_Impl.java:156) at com.google.android.sensory.sensing_sdk.db.impl.dao.ResourceInfoDao_Impl$3.call(ResourceInfoDao_Impl.java:151) at androidx.room.CoroutinesRoom$Companion.execute(CoroutinesRoom.kt:57) at androidx.room.CoroutinesRoom.execute(Unknown Source:2) at com.google.android.sensory.sensing_sdk.db.impl.dao.ResourceInfoDao_Impl.insertResourceInfoEntity(ResourceInfoDao_Impl.java:151) at com.google.android.sensory.sensing_sdk.db.impl.dao.ResourceInfoDao.insertResourceInfo$suspendImpl(ResourceInfoDao.kt:35) at com.google.android.sensory.sensing_sdk.db.impl.dao.ResourceInfoDao.insertResourceInfo(Unknown Source:0) at com.google.android.sensory.sensing_sdk.db.impl.dao.ResourceInfoDao_Impl.access$401(ResourceInfoDao_Impl.java:34) at com.google.android.sensory.sensing_sdk.db.impl.dao.ResourceInfoDao_Impl.lambda$insertResourceInfo$0(ResourceInfoDao_Impl.java:187) at com.google.android.sensory.sensing_sdk.db.impl.dao.ResourceInfoDao_Impl.$r8$lambda$34jYblWdaNM0XmdTxFHyZ9jf0K4(Unknown Source:0) at com.google.android.sensory.sensing_sdk.db.impl.dao.ResourceInfoDao_Impl$$ExternalSyntheticLambda0.invoke(Unknown Source:6) at androidx.room.RoomDatabaseKt$withTransaction$2.invokeSuspend(RoomDatabase.kt:58) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284) at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85) at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking(Builders.kt:59) at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source:1) at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking$default(Builders.kt:38) at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1) at androidx.room.RoomDatabaseKt$acquireTransactionThread$2$2.run(RoomDatabase.kt:121) at androidx.room.TransactionExecutor$1.run(TransactionExecutor.java:47) 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)

@MJ1998