Skip to content

feat(auto-upload): support end-to-end encrypted folders - #18028

Open
xO-ox-ai wants to merge 2 commits into
nextcloud:masterfrom
xO-ox-ai:feat/e2ee-auto-upload
Open

xO-ox-ai wants to merge 2 commits into
nextcloud:masterfrom
xO-ox-ai:feat/e2ee-auto-upload

Conversation

@xO-ox-ai

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

Copy link
Copy Markdown

Automatic upload currently prevents selecting an end-to-end encrypted destination. This change allows existing E2EE folders as destinations and uses the existing encrypted upload operations. Testing also exposed problems with identical-file conflicts, completed-upload links, first-open previews and locally available thumbnails; the accompanying fixes keep those paths usable for encrypted automatic uploads.

Uploads and conflicts

  • Resolve visible destination paths through fresh directory listings and the existing OCFile metadata mapping. Create missing descendants through the existing folder operations, including encrypted descendants within ordinary automatic-upload roots.
  • Apply skip, rename, overwrite and ask-user policies to decrypted names, including file/folder collisions. Keep clients, keys, capabilities and queue actions bound to the upload's owning account. Missing keys or unreadable metadata leave work pending.
  • Compare authenticated plaintext before reporting a same-name encrypted file as conflicting. Identical content follows the existing successful/skipped-upload flow. Genuine conflicts show the decrypted server version and its plaintext size.
  • Cache comparison results against the local size/modification time and the remote ETag, identity, size, modification time and encryption metadata. Unchanged versions reuse the result instead of downloading and decrypting the file repeatedly. Reuse an already verified plaintext copy when resolving a conflict requires it, and clean temporary comparison/download files.
  • Reuse server locks, counters and rollback for failed encrypted writes. A removed destination is recreated according to its current parent. This remains one-way automatic upload; local deletions do not delete remote files.

Completed uploads, previews and thumbnails

  • Preserve decrypted display names, transfer progress, completion results and links to the actual uploaded file. Previously failed identical-file records can finish through the normal upload-result flow.
  • Open completed encrypted uploads through the existing file-opening flow, with authenticated decryption after download. Create missing local directories, publish plaintext only after authentication succeeds, and clean temporary ciphertext/plaintext on failure or cancellation.
  • Resolve download-completion events by account and physical remote path so the first completed PDF download opens its content immediately.
  • Generate image/video thumbnails from readable upload originals for every upload-list state. Encrypted folder listings can also find retained originals through completed-upload or persistent automatic-upload records, including after upload history is cleared. No encrypted original is downloaded just for a thumbnail, and generated thumbnails are not uploaded. Local PDF/Office thumbnail rendering is outside this change.

Validation

  • Human testing on an OPPO PMA120 with Android 17/API 37 against Nextcloud Server 35.0.2 confirmed encrypted automatic uploads of new files, identical-content skips, readable upload names, completed-file opening, first-download PDF previews, and thumbnails in both encrypted folders and the upload list. The latest personal QA integration build was 35.2.0-test.20261112.10.
  • That QA build also included separate certificate-validation and settings-log-export PRs. Those changes, the separately submitted image EXIF-reading fix, and personal QA build configuration are not included here. The additional fix files were checked against the tested build when consolidating this branch.
  • On the consolidated PR branch, 116 focused JVM tests passed across 25 suites, with no failures or errors. Coverage includes folder resolution, account identity, collision policies, authenticated comparison/downloads, temporary-file cleanup, completed-upload links, preview-event resolution and thumbnail sources. Two existing ordinary-path tests were excluded because they depend on Android/Linux java.io.File path semantics.
  • Gplay application/test compilation, Kotlin formatting, Detekt and Android Lint completed. Lint reports 0 errors, 0 warnings and 3 existing hints; Detekt retains 2 findings in unchanged files. Checks used JDK 21, installed Gradle 9.8.2 and disabled KSP incremental compilation; repository build configuration is unchanged.
  • A separate Java argument-file analysis covered 152 class files corresponding to the 34 production files in the added fix commit. The consolidated branch and tested QA baseline both produced 322 reports, with no new report type/class/method keys and no analysis errors; unresolved auxiliary classes remain. This is not a clean SpotBugs result.

Checklist

  • Tests are included.
  • No backport is requested.
  • Milestone is set.
  • PR title describes the user-visible feature.

AI disclosure

  • The content of this PR was partly or fully generated using AI.

Codex assisted implementation, tests, consolidation and this description under the contributor's direction. AI-assisted commits retain their Assisted-by trailers.

Reuse encrypted folder metadata and existing upload operations for automatic uploads, including account ownership, collision handling, and server rollback.

Assisted-by: Codex:GPT-6
Signed-off-by: Li Wei <caeser222000@sohu.com>
@xO-ox-ai
xO-ox-ai force-pushed the feat/e2ee-auto-upload branch from 805553a to c6c5300 Compare November 12, 2026 02:16
Verify same-name encrypted files using authenticated plaintext and cache unchanged versions. Reuse verified downloads, complete identical-file records through the existing upload flow, and clean temporary plaintext and ciphertext.

Preserve upload names, results and progress; authenticate encrypted downloads before publication; resolve first-open preview events by account and physical path; reuse local originals for upload and encrypted-folder thumbnails.

Assisted-by: Codex:GPT-6
Signed-off-by: Li Wei <caeser222000@sohu.com>
@xO-ox-ai
xO-ox-ai marked this pull request as ready for review November 12, 2026 14:43

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