Skip to content

Conversation

@alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Jan 19, 2026

  • Tests written, or not not needed

Issue

After migrating file uploads from a foreground service to worker, the previous mechanism for notifying activities such as UploadListActivity and FileDisplayActivity via LocalBroadcastManager stopped functioning correctly.

Specifically:

Once an upload completes, the adapters (OCFileListAdapter, UploadListAdapter) are not refreshed with the updated data.
Upload start and completion events were not correctly triggered in UploadListActivity and FileDisplayActivity, preventing proper UI updates.

Changes

Ensured worker state is correctly updated in finally blocks to maintain consistency.
The adapter is now notified correctly when the FileUploadWorker finishes.
Restored previously working LocalBroadcastManager logic for notifying activities.
Removed FileUploadStarted and FileUploadCompleted worker states, as broadcasts are now used.
Broadcast receivers are registered in onStart and unregistered in onStop for proper lifecycle handling.
Added clear documentation to functions describing their purpose and expected triggers.
Adds file upload completion event for AutoUploadWorker.

Test

  1. When a user manually uploads a file or files or uploads files via AutoUploadWorker, FileDisplayActivity, UploadListActivity must display an updated list after the file or files upload completion. The adapter must not be triggered excessively; it must be triggered only batch by batch.

Impact

With this change, users can see updates in real time in the file list and upload list tabs.

@alperozturk96 alperozturk96 added the ux-enhancement Improvements that refine user interactions, accessibility, or overall usability label Jan 19, 2026
@alperozturk96 alperozturk96 mentioned this pull request Jan 20, 2026
1 task
@github-actions
Copy link

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/16317.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@github-actions
Copy link

Codacy

SpotBugs

CategoryBaseNew
Bad practice4343
Correctness7474
Dodgy code257256
Experimental11
Internationalization77
Malicious code vulnerability33
Multithreaded correctness3434
Performance4343
Security1818
Total480479

@github-actions
Copy link

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

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

Labels

3. to review ux-enhancement Improvements that refine user interactions, accessibility, or overall usability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants