Skip to content

Keeping track of and restart interrupted uploads #5371

Closed
Tup0lev wants to merge 2 commits intocommons-app:mainfrom
Tup0lev:main
Closed

Keeping track of and restart interrupted uploads #5371
Tup0lev wants to merge 2 commits intocommons-app:mainfrom
Tup0lev:main

Conversation

@Tup0lev
Copy link

@Tup0lev Tup0lev commented Oct 29, 2023

Description (required)
Add the ability to keep track of and reupload interrupted uploads

Fixes #5282

What changes did you make and why?
Added a Java class to record unfinished uploads on disk, to keep track of the uploads across app closure/device restarts.
Tests performed (required)

Tested {Beta} on {Pixel 7 Pro} with API level {33}.

Screenshots (for UI changes only)

Need help? See https://support.google.com/android/answer/9075928


Note: Please ensure that you have read CONTRIBUTING.md if this is your first pull request.

alertDialogBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//TODO: restart the upload
Copy link
Member

Choose a reason for hiding this comment

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

This would be an important part I guess. 🙂

/**
* In-memory list of contributions whose uploads have not been properly fnished
*/
public static Map<String, Boolean> unfinishedUploads = new HashMap<>();
Copy link
Member

Choose a reason for hiding this comment

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

Better avoid public members, especially for modifyable data structures. Better make it private and add public methods to modify the data in intended ways.

/**
* Notifies the user about unfinished uploads.
*/
private void notifyUser() {
Copy link
Member

Choose a reason for hiding this comment

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

Ideally retry would happen automatically, with no user action.

@sivaraam
Copy link
Member

sivaraam commented Feb 9, 2024

@Tup0lev Thanks for your contribution. 🙂

Just pinging to know if you could look into comments given by Nicolas

@Tup0lev Tup0lev closed this Feb 9, 2024
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.

Upload gets stuck after the app has been closed/killed or the device has been rebooted

3 participants