commons-app / apps-android-commons

The Wikimedia Commons Android app allows users to upload pictures from their Android phone/tablet to Wikimedia Commons
https://commons-app.github.io/
Apache License 2.0
1.03k stars 1.24k forks source link

Erratic behaviour of upload flow, when uploads are paused #5524

Open ShashwatKedia opened 9 months ago

ShashwatKedia commented 9 months ago

Summary

While trying to upload multiple images and pausing some, the app was behaving erratically. When I first pause the uploads, which are yet to be started, and then pause the current upload, the app automatically starts the next upload, even though it is paused. Doing this for 2-3 items crashes the app recording. Also, after closing the app and opening again, it starts the upload of the 1st item even though it is paused (also the pause button does not have a cancel button) recording.

Possible solutions can be:

  1. Checking whether the next item to be uploaded is paused or not, before forcefully starting its upload
  2. Hiding the pause and play button from uploads which have not started, and only keep a remove button, till the upload of that item starts

I personally prefer the second solution, as there is no need to pause the items which are yet to be uploaded. But if maintainers think otherwise, then implementing the first one shouldn't be a big trouble.

Steps to reproduce

  1. Open the app and upload multiple images (around 5)
  2. Pause the uploads which are yet to be started
  3. Pause the item whose upload is in progress

Expected behaviour

The app should look for the next un-uploaded item which is not paused, and it's upload.

Actual behaviour

The app forcefully starts the upload of the next item in queue, even though it was paused. Doing this multiple times crashes the app.

Device name

OnePlus Nord CE 2 Lite

Android version

Android 12

Commons app version

main prodDebug

Device logs

No response

Screen-shots

No response

Would you like to work on the issue?

Yes

ShashwatKedia commented 9 months ago

@nicolas-raoul, I think this can also be added to the GSoC proposal ideas, as this, too, is related to improving the upload queue management. If not, then I would like to start work on this :)

nicolas-raoul commented 9 months ago

I have kind of given up on the pausing feature for now because the queuing is unreliable even without pausing... if you think you can fix it in a GSoC, I suggest putting it at the end of the schedule. 🙂