Skip to content

fix(auto-upload): work policy#16555

Merged
alperozturk96 merged 5 commits intomasterfrom
fix/auto-upload-policy
Mar 4, 2026
Merged

fix(auto-upload): work policy#16555
alperozturk96 merged 5 commits intomasterfrom
fix/auto-upload-policy

Conversation

@alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Feb 20, 2026

Changes

Auto upload content insertion done in ContentObserver
Fixes auto upload work policy since ContentObserver may trigger auto upload worker multiple times it was causing Job cancellation
ensureActiveness of Auto upload worker
Check pending files in AutoUploadWorker instead of relying content uri since entries previously inserted

@alperozturk96
Copy link
Collaborator Author

/backport to stable-3.36

@nextcloud nextcloud deleted a comment from github-actions bot Feb 20, 2026
return true
}

if (backgroundJobManager.isAutoUploadWorkerRunning(syncedFolderID)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Don't interfere, work manager already handling it via policy.

@tobiasKaminsky
Copy link
Member

java.lang.NullPointerException: Parameter specified as non-null is null: method com.nextcloud.client.jobs.autoUpload.FileSystemRepository.<init>, parameter dao
	at com.nextcloud.client.jobs.autoUpload.FileSystemRepository.<init>(FileSystemRepository.kt)
	at com.nextcloud.client.jobs.BackgroundJobFactory.createContentObserverJob(BackgroundJobFactory.kt:138)
	at com.nextcloud.client.jobs.BackgroundJobFactory.createWorker(BackgroundJobFactory.kt:86)
	at com.nextcloud.client.jobs.BackgroundJobFactoryTest.content_observer_worker_is_created(BackgroundJobFactoryTest.kt:154)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)

Copy link
Member

@tobiasKaminsky tobiasKaminsky left a comment

Choose a reason for hiding this comment

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

please fix unit test

@alperozturk96 alperozturk96 force-pushed the fix/auto-upload-policy branch from fb43a1e to 14f94a2 Compare March 4, 2026 10:23
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>
@alperozturk96 alperozturk96 force-pushed the fix/auto-upload-policy branch from 6e740c3 to 53082aa Compare March 4, 2026 10:30
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

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

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

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

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Codacy

SpotBugs

CategoryBaseNew
Bad practice4242
Correctness7575
Dodgy code252252
Experimental11
Internationalization77
Malicious code vulnerability22
Multithreaded correctness3434
Performance4343
Security1818
Total474474

@alperozturk96 alperozturk96 added this to the Nextcloud App 33.1.0 milestone Mar 4, 2026
@alperozturk96
Copy link
Collaborator Author

please fix unit test

Screenshot 2026-03-04 at 11 52 12

@alperozturk96 alperozturk96 merged commit a4d3bee into master Mar 4, 2026
15 of 20 checks passed
@alperozturk96 alperozturk96 deleted the fix/auto-upload-policy branch March 4, 2026 10:52
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