The issue with database access has been fixed: due to incorrect database access, the access failed, causing a crash at the end of the upload, which made normal testing impossible. The UploadWorker has been fixed to ensure that database access occurs on the correct thread.

This commit is contained in:
Quiet 2024-10-27 00:27:04 +11:00
parent 7c58891892
commit 3c80d205fa

View file

@ -535,14 +535,16 @@ class UploadWorker(
val imageSha1 = contribution.imageSHA1.toString()
val modifiedSha1 = fileUtilsWrapper.getSHA1(fileUtilsWrapper.getFileInputStream(contribution.localUri?.path))
MainScope().launch {
uploadedStatusDao.insertUploaded(
UploadedStatus(
imageSha1,
modifiedSha1,
imageSha1 == modifiedSha1,
true,
),
)
withContext(Dispatchers.IO){
uploadedStatusDao.insertUploaded(
UploadedStatus(
imageSha1,
modifiedSha1,
imageSha1 == modifiedSha1,
true,
),
)
}
}
}
}