mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	Fixes 4344 - Duplicate Uploads (#4442)
* Fixes 4344 - Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries. * Update states to IN_PROGRESS before uploads are processed
This commit is contained in:
		
							parent
							
								
									09cacde670
								
							
						
					
					
						commit
						10ed6678b3
					
				
					 3 changed files with 59 additions and 56 deletions
				
			
		|  | @ -318,7 +318,7 @@ public class MainActivity  extends BaseActivity | |||
|         } else { | ||||
|             WorkManager.getInstance(getApplicationContext()).enqueueUniqueWork( | ||||
|                 UploadWorker.class.getSimpleName(), | ||||
|                 ExistingWorkPolicy.KEEP, OneTimeWorkRequest.from(UploadWorker.class)); | ||||
|                 ExistingWorkPolicy.APPEND_OR_REPLACE, OneTimeWorkRequest.from(UploadWorker.class)); | ||||
| 
 | ||||
|             viewUtilWrapper | ||||
|                 .showShortToast(getBaseContext(), getString(R.string.limited_connection_disabled)); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ashish
						Ashish