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

Stop Uploads When the Device Doesn’t Have an Internet Connection #14364

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Jan 9, 2025

  • Tests written, or not not needed

Problem

When the device lacks an active internet connection or is in airplane mode, the app continues attempting to upload files. This results in numerous “upload failed” notifications appearing repeatedly.

How to Test

  1. Attempt to upload multiple files
  2. During the upload process, disconnect the internet or enable airplane mode.
  3. Observe that multiple error notifications are generated.

@tobiasKaminsky tobiasKaminsky added this to the Nextcloud App 3.31.0 milestone Jan 21, 2025
@alperozturk96 alperozturk96 force-pushed the stop-upload-when-device-not-have-internet-connection branch 2 times, most recently from 4ae3b5e to a155284 Compare January 22, 2025 07:58
fun showConnectionErrorNotification() {
notificationBuilder.run {
setContentTitle(context.getString(R.string.file_upload_worker_error_notification_title))
setContentText("")
Copy link
Member

Choose a reason for hiding this comment

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

Will it retry once a network connection is detected?
If so, we can add this info here as text.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If the FileUploadWorker is triggered for auto-upload, it will run again. However, if it is triggered for manual file upload, it will not. We could indicate this detail, but it might be too much information for the user.

@alperozturk96 alperozturk96 force-pushed the stop-upload-when-device-not-have-internet-connection branch 2 times, most recently from 402220c to a17ce74 Compare January 22, 2025 13:32
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
@alperozturk96 alperozturk96 force-pushed the stop-upload-when-device-not-have-internet-connection branch from 1b6af1b to 6966ce5 Compare January 24, 2025 08:12
Copy link

Codacy

Lint

TypemasterPR
Warnings5555
Errors33

SpotBugs

CategoryBaseNew
Bad practice6565
Correctness5757
Dodgy code294294
Experimental11
Internationalization77
Malicious code vulnerability11
Multithreaded correctness77
Performance5353
Security1818
Total503503

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

Successfully merging this pull request may close these issues.

2 participants