Skip to content

Conversation

alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Oct 10, 2025

  • Tests written, or not not needed

Fixes

ContentObserverWork may fail due to the execution of other workers, such as backgroundJobManager.startMediaFoldersDetectionJob(). Such failures can prevent the auto upload of changed files from being triggered.

Previously, ContentObserverWork ran as a regular background worker, which could be terminated by the system under rapid or heavy file changes, causing some uploads not to be triggered. Making it a long-running task ensures all triggers are reliably executed, and the OS is aware of this critical monitoring process.

Demo

Screenshot 2025-10-10 at 12 23 03

How to test?

  1. Set up a folder for auto-upload, e.g., the Pictures directory.
  2. Capture a photo using the Camera app that saves it to the configured folder.
  3. Verify that the new or changed file appears in the auto-upload folder and is processed correctly.

Note

The notification will only be shown when new files are detected.

Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
@alperozturk96 alperozturk96 force-pushed the fix/content-observer-work branch from c2796a5 to e307143 Compare October 10, 2025 10:41
<string name="notification_channel_offline_operations_name_short">Offline operations</string>
<string name="notification_channel_offline_operations_description">Shows progress of offline file operations</string>

<string name="content_observer_work_notification_title">Detecting content changes</string>
Copy link
Collaborator Author

@alperozturk96 alperozturk96 Oct 10, 2025

Choose a reason for hiding this comment

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

@kra-mo

The notification for ContentObserverWork is only displayed when the user has enabled a folder for auto-upload, such as the DCIM directory and when the user takes a photo using the Camera app, the content observer worker will trigger and display the notification if any new files there. In practice, the notification will appear briefly.

Notification is mandatory to make ContentObserverWork long-running task. ContentObserverWork triggers to AutoUpload thus it is needed to making it a long-running task ensures all triggers are executed.

Could you review the current wording for the notification title, channel name, and description?

Signed-off-by: alperozturk <alper_ozturk@proton.me>
Copy link

Copy link

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/15767.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.

Copy link

Codacy

Lint

TypemasterPR
Warnings4545
Errors1111

SpotBugs

CategoryBaseNew
Bad practice4646
Correctness7474
Dodgy code267267
Experimental11
Internationalization77
Malicious code vulnerability22
Multithreaded correctness3535
Performance4949
Security1818
Total499499

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.

1 participant