Skip to content

fix(auto-upload): allow empty files unchanged for one hour - #18041

Open
xO-ox-ai wants to merge 1 commit into
nextcloud:masterfrom
xO-ox-ai:fix/auto-upload-stable-empty-files
Open

xO-ox-ai wants to merge 1 commit into
nextcloud:masterfrom
xO-ox-ai:fix/auto-upload-stable-empty-files

Conversation

@xO-ox-ai

@xO-ox-ai xO-ox-ai commented Nov 12, 2026 •

Copy link
Copy Markdown

Automatic upload currently skips every zero-byte file, including intentional empty files. Allow an empty regular file once its valid filesystem modification time is at least one hour old. Recently modified empty files remain deferred, and files that gain content can upload immediately. Preserve the camera/MediaStore comment and add an explanation for the grace period.

Deferred files remain pending for the next automatic scan; this does not schedule an upload exactly one hour later. Unknown or future modification times remain deferred. No additional write-state checks are introduced.

Validation

  • 10 focused unit tests passed, covering the one-hour boundary, modification-time changes, empty-to-nonempty transitions, invalid/future timestamps, missing files and directories.
  • Gplay debug Kotlin/Java compilation passed.
  • Android lint passed: 0 errors, 0 warnings, 3 hints outside the changed files.
  • spotlessKotlinCheck, detekt and git diff --check passed.
  • Tested locally with Java 21 and cached Gradle 9.8.2.
  • Running SpotBugs separately with an argument file produced 250 findings across the project's Java classes and reported missing analysis classes; this is not a clean SpotBugs result. No Java source files are changed by this PR.

Checklist

  • Tests are included.
  • PR title describes the behavior.
  • Human review and contributor DCO sign-off.

AI assistance

  • This PR was generated with assistance from OpenAI Codex (GPT-6).

Keep deferring recently modified empty files to avoid uploading camera placeholders. Allow intentional empty files once their modification time is at least one hour old, and cover the grace-period boundaries and file transitions.

Assisted-by: Codex:GPT-6
Signed-off-by: Li Wei <caeser222000@sohu.com>
@xO-ox-ai
xO-ox-ai force-pushed the fix/auto-upload-stable-empty-files branch from ab79940 to 66c8262 Compare November 12, 2026 14:36
@xO-ox-ai
xO-ox-ai marked this pull request as ready for review November 12, 2026 14:40

This branch has not been deployed

No deployments
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.

1 participant