Skip to content
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

Added pending uploads screen #5752

Merged
merged 135 commits into from
Aug 30, 2024
Merged

Conversation

kanahia1
Copy link
Contributor

@kanahia1 kanahia1 commented Jun 8, 2024

Description (required)

Fixes #5583

What changes did you make and why?

Tests performed (required)

Tested prodDebug on Samsung S21 FE with API level 33.

Screenshots (for UI changes only)

WhatsApp.Video.2024-06-08.at.17.08.37_459ee7ba.mp4

⚙️To-do list -

  • Implement upload as real queue
  • Implement resume/pause
  • Handle errors

@nicolas-raoul
Copy link
Member

Looks great! 🙂

@kanahia1
Copy link
Contributor Author

kanahia1 commented Jun 9, 2024

Added error fragment

WhatsApp.Video.2024-06-09.at.18.19.25_8a3bde9e.mp4

@kanahia1
Copy link
Contributor Author

kanahia1 commented Jun 19, 2024

Here are the few bugs/issues that I have found and currently working on, will make the PR ready for review after solving them

  • Delete upload not working properly when deleting on going upload
  • Bug with top bar while pausing/resuming
  • Notification keeps on showing even after deleting upload then it adds it to failed uploads
  • Refreshing issue with few image thumbnails when uploading large number of uploads (>8)
  • Recycler View takes time to load
  • Need to work on the notification, when clicking Tap to View
  • Need to work on Auto-Retry

@kanahia1 kanahia1 marked this pull request as ready for review June 22, 2024 18:01
@nicolas-raoul
Copy link
Member

I started a multiupload of 71 pictures.
Strangely the numbers shown by the UI were less, I took these screenshots shortly after starting the upload:
Screenshot_20240625-232854~2.png
Screenshot_20240625-232937~2.png
Luckily all 71 uploads succeded, though.

@kanahia1
Copy link
Contributor Author

Will look into it.

@kanahia1
Copy link
Contributor Author

kanahia1 commented Jun 27, 2024

I tested it with 105 uploads it seems to show me 30, when I logged the contributions in PendingUploadsFragment only 30 were not null and others seems to be null. But, on inspecting the database using App Inspector all the contributions seem alright.

Copy link
Collaborator

@RitikaPahwa4444 RitikaPahwa4444 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Left a few minor suggestions.

One thing I often observe is that the progress bar in the notification regresses quite frequently. Maybe we could not estimate the exact progress, but would it be possible to stop at the current progress itself if at all we have to reduce it?

}
}

fun deleteUploads(){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about generalising this method as well? This is being used in the failed uploads fragment too.

fun retryUpload(contribution: Contribution) {
if (NetworkUtils.isInternetConnectionEstablished(context)) {
if (contribution.state == Contribution.STATE_PAUSED
|| contribution.state == Contribution.STATE_QUEUED_LIMITED_CONNECTION_MODE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are we currently supporting limited connection mode? Is this by using the pause button in the top bar?

if (CommonsApplication.cancelledUploads.contains(contribution.pageId)) {
compositeDisposable.clear()
return@forEach
}else{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, we still don't have a linter on our repository. Would you mind making the spaces around if-else blocks more consistent? We follow the Java style guide.

@@ -188,7 +189,7 @@ class UploadWorker(var appContext: Context, workerParams: WorkerParameters) :
.blockingGet()
//Showing initial notification for the number of uploads being processed

Timber.e("Queued Contributions: " + queuedContributions.size)
Timber.tag("PRINT").e("Queued Contributions: " + queuedContributions.size)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're planning to club the log messages together, then I would suggest using a more specific name.

@kanahia1
Copy link
Contributor Author

@RitikaPahwa4444, Thanks for reviewing it, I will try to share a newer commit asap

@kanahia1
Copy link
Contributor Author

kanahia1 commented Jun 30, 2024

Hi @RitikaPahwa4444, I have made the fixes in the newer commit 04c102d Needs to work on the notification progress bar though

@kanahia1
Copy link
Contributor Author

kanahia1 commented Aug 23, 2024

Hi @nicolas-raoul, Failure of uploadFileToStash_returnsFailureIfNothingToUpload (ignoring this test started chain of failing tests) was first noticed after this commit 7a1e381

on 24 June
https://github.com/commons-app/apps-android-commons/actions/runs/9627472314/job/26612209487?pr=5752

Error received - org.mockito.exceptions.misusing.UnfinishedVerificationException

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: kdoc

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging for now to avoid diverging from main, #5280 and #5284 can be separate pull requests.

@nicolas-raoul nicolas-raoul merged commit 93f1e1e into commons-app:main Aug 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Discussion] Upload Queue Management UI/UX
3 participants