Skip to content

Abort a hydration request on failure - #1067

Merged
TheOneRing merged 2 commits into
mainfrom
work/abort_hydration
Sep 1, 2026
Merged

TheOneRing merged 2 commits into
mainfrom
work/abort_hydration

Conversation

@TheOneRing

@TheOneRing TheOneRing commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Fixes: #1060

image

@guruz guruz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

probably good

@TheOneRing
TheOneRing force-pushed the work/abort_hydration branch from 4c7efbb to 1659ade Compare August 31, 2026 11:00
@TheOneRing
TheOneRing enabled auto-merge (rebase) August 31, 2026 11:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new CFAPI error completion path likely passes an invalid TransferData buffer/length combination on failure, risking CfExecute failing and leaving hydration requests improperly completed.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR addresses a crash in the CFAPI VFS hydration path when a dehydrated placeholder is hydrated but the corresponding remote file is already gone (e.g., renamed/deleted and the change hasn’t propagated locally yet), by treating a 404 as an out-of-sync condition and ensuring the hydration request is completed with an error.

Changes:

  • Add a regression test that forces a single 404 on hydration and verifies needSync is emitted for dehydrated files.
  • Treat HTTP 404 during hydration as “file not found” and emit needSync to recover from out-of-sync metadata.
  • On hydration failure, attempt to complete the CFAPI transfer operation with an error via CfExecute.
File summaries
File Description
test/testdownload.cpp Adds a dehydrated-file regression test for a one-time 404 hydration failure triggering needSync.
src/plugins/vfs/cfapi/hydrationdevice.cpp Reports hydration failure back to CFAPI via CfExecute so the request is completed/aborted on error.
src/libsync/vfs/hydrationjob.h Exposes the hydration device via a new accessor.
src/libsync/vfs/hydrationjob.cpp Adds explicit handling for HTTP 404 to emit needSync and report “File not found”.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


QByteArray fileId() const { return _fileId; }

QIODevice *device() const { return _device.get(); }
Comment on lines +73 to +77
opParams.TransferData.CompletionStatus = STATUS_CLOUD_FILE_NOT_IN_SYNC;

// the error affects the whole file, not a transfer chunk
opParams.TransferData.Offset.QuadPart = 0;
opParams.TransferData.Length.QuadPart = totalSize;
@TheOneRing
TheOneRing merged commit 28a6693 into main Sep 1, 2026
11 of 15 checks passed
@TheOneRing
TheOneRing deleted the work/abort_hydration branch September 1, 2026 11:15
@openclouders openclouders mentioned this pull request Aug 31, 2026
1 task
@saw-jan saw-jan mentioned this pull request Sep 2, 2026
9 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cfapi: Strange behaviour on hydration of out of sync file

3 participants