Skip to content

Cancelling an upload does not really cancel it #5346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nicolas-raoul opened this issue Oct 18, 2023 · 5 comments · Fixed by #5367
Closed

Cancelling an upload does not really cancel it #5346

nicolas-raoul opened this issue Oct 18, 2023 · 5 comments · Fixed by #5367
Assignees
Labels

Comments

@nicolas-raoul
Copy link
Member

Scenario: You upload 5 pictures of a monument, but while it is uploading you suddenly realize that two of the pictures are privacy violations (for instance they are private family pictures). You want to cancel these two uploads, so for each of them you tap the pause button then the "X" delete button.

Problem: These two pictures actually get uploaded as well.

This is probably a rather difficult issue, as you will need to read the code and understand how the app retries failed uploads.

@RitikaPahwa4444
Copy link
Collaborator

For me, the cancel button is working correctly only for the ongoing upload. For the upcoming contributions, this does not work, which means only the first contribution in the queuedContributions list is impacted by the delete operation. Tapping the button apparently deletes the contribution from the database, so the retry logic should not find the entry at all🤔

@OnClick(R.id.cancelButton)
public void deleteUpload() {
callback.deleteUpload(contribution);
}

@RitikaPahwa4444
Copy link
Collaborator

I suspect if this line adds the contribution again to the database using the insert operation:

@nicolas-raoul
Copy link
Member Author

Thanks Ritika, great insight! :-)

@RitikaPahwa4444
Copy link
Collaborator

May I take this up? Since this issue is very similar to my GSoC task (#5136), I was curious to explore and find some more solutions.

The cause is exactly the same: queuedContributions list does not get updated once it has fetched the contributions from the database. So, one way to fix this issue is to replicate that idea. I've got a few more ways to approach this issue:

  • We're using a one-shot query, so using an observable query might also help. This seems like an intuitive way to me, but needs to be handled carefully.
  • The approaches above will require us to check the database frequently for any changes. These database calls could be avoided altogether using an in-memory hashset for cancelled uploads, just like the one we've for paused uploads.

@nicolas-raoul
Copy link
Member Author

@RitikaPahwa4444 Please do not feel obligated to, but if you want to take it then of course you are more than welcome! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants