feat(files): resume chunked sync uploads - #423
Conversation
Obiente previewNC Native · Obiente updates this comment as the preview changes. |
e54db03 to
efeb92e
Compare
… fix/resumable-sync-uploads
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d0521b39e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f1f8e5ba1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 67c656bf22
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 921a4a9112
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc548371e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de0d5ae123
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a27b516149
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f130cebe5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| FileSyncPendingUploadCleanup( | ||
| checkpoint.uploadId, | ||
| work.relativePath, | ||
| checkpoint.assembledStageEtag, | ||
| work.replacementBackupEtag(), | ||
| ) |
There was a problem hiding this comment.
Preserve chunked publication state when abandoning work
When a chunked file-over-directory MOVE succeeds and the client exits before verification, deleting the local source before the next scan causes this conversion to abandon the checkpoint while retaining only the stage and backup ETags. The resulting cleanup defaults publicationInFlight to false and carries no content evidence, so the following run's discardOwnedUpload treats the visible file as staging, deletes it when its ETag matches assembledStageEtag, and restores the old directory. Unlike the newly added direct-replacement recovery, this chunked path still loses the publication evidence; retain enough checkpoint state to reconcile the published file instead of rolling it back.
AGENTS.md reference: AGENTS.md:L428-L430
Useful? React with 👍 / 👎.
| moveRemotePath( | ||
| stagingPath, destinationPath, verifiedStageEtag, sourceIsDirectory = false, | ||
| mutationRelativePaths = arrayOf(relativePath), | ||
| ) |
There was a problem hiding this comment.
Cancel direct replacement publication when sync pauses
When desktop sync is paused while this direct replacement's final MOVE is waiting for a response, moveRemotePath executes through DesktopHttpMutationExecutor without the available shouldContinue callback. The file-sync client has no whole-call timeout and a 30-minute inactivity timeout, so the paused run can remain blocked and the server mutation can continue; the latest cancellation fix covers chunked publication but leaves this direct-replacement path uncancelled.
AGENTS.md reference: AGENTS.md:L274-L276
Useful? React with 👍 / 👎.
Outcome
The resume and reconciliation behavior follows the Nextcloud chunking-v2 documentation and the official desktop client's contiguous-prefix recovery model:
Verification
bash tools/check-repository.sh:ui:desktopTest :androidApp:testDebugUnitTest:androidApp:verifyReleaseLintGate:androidApp:assembleDebug:ui:createDistributablewith direct desktop package updates enabledCompatibility and risk
Nextcloud's documented 5 MiB to 5 GiB chunk sizes and 10,000-chunk collection maximum are protocol constraints, not client file eligibility limits. Files outside a safe chunk plan remain transferable through the direct streaming path. Persisted snapshots without an upload checkpoint remain compatible through the checkpoint field's default value.
The visible destination is never used as the assembly target. An interrupted or rejected transfer can therefore clean up only its UUID-owned collection and stage without overwriting an unrelated local or remote generation.
Visual changes
Not applicable.
Closes #113