mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	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:
		
							parent
							
								
									7c58891892
								
							
						
					
					
						commit
						3c80d205fa
					
				
					 1 changed files with 10 additions and 8 deletions
				
			
		|  | @ -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, | ||||
|                         ), | ||||
|                     ) | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Quiet
						Quiet