Skip to content

Cfapi: Prevent move of dehydrated placeholder to ignored location - #454

Merged
TheOneRing merged 5 commits into
mainfrom
work/move
Aug 7, 2025
Merged

TheOneRing merged 5 commits into
mainfrom
work/move

Conversation

@TheOneRing

Copy link
Copy Markdown
Contributor

No description provided.

@TheOneRing TheOneRing changed the title Work/move Cfapi: Prevent move of dehydrated placeholder to ignored location Aug 6, 2025
@TheOneRing TheOneRing linked an issue Aug 6, 2025 that may be closed by this pull request
@TheOneRing TheOneRing removed a link to an issue Aug 6, 2025
@TheOneRing
TheOneRing marked this pull request as ready for review August 6, 2025 14:10
@TheOneRing
TheOneRing requested a review from Copilot August 6, 2025 14:10

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.

Pull Request Overview

This PR refactors the CloudFiles API (CFAPI) implementation to prevent moves of dehydrated placeholders to ignored locations. The changes centralize callback context information into a single structure and add logic to reject problematic file moves.

Key changes:

  • Introduces CallBackContext structure to encapsulate callback parameters
  • Replaces string-based request IDs with numeric IDs throughout the hydration workflow
  • Adds rename handling to prevent moves of dehydrated placeholders to ignored directories

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
vfs_cfapi.h Updates method signatures to use CallBackContext and int64_t request IDs
vfs_cfapi.cpp Refactors hydration methods to work with new context structure
hydrationjob.h Changes constructor and removes setter methods for context data
hydrationjob.cpp Updates implementation to use embedded context instead of separate fields
cfapiwrapper.h Defines new CallBackContext structure and debug operator
cfapiwrapper.cpp Implements context-based callbacks and adds rename rejection logic
filesystem.cpp Adds assertion for file existence validation

Comment thread src/plugins/vfs/cfapi/cfapiwrapper.cpp Resolved
Comment thread src/plugins/vfs/cfapi/cfapiwrapper.cpp Resolved
const auto result = _journal->setFileRecord(SyncJournalFileRecord::fromSyncFileItem(*item));
if (!result) {
qCWarning(lcHydration) << "Error when setting the file record to the database" << _localFilePathAbs << result.error();
if (QFileInfo::exists(localFilePathAbs())) {

Copilot AI Aug 6, 2025

Copy link

Choose a reason for hiding this comment

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

Using QFileInfo::exists() as a static method is deprecated. Use QFileInfo(path).exists() instead.

Suggested change
if (QFileInfo::exists(localFilePathAbs())) {
if (QFileInfo(localFilePathAbs()).exists()) {

Copilot uses AI. Check for mistakes.
Comment thread src/plugins/vfs/cfapi/cfapiwrapper.cpp Resolved
@TheOneRing
TheOneRing force-pushed the work/move branch 3 times, most recently from c42fe2a to bc74953 Compare August 7, 2025 14:33
@TheOneRing
TheOneRing enabled auto-merge (rebase) August 7, 2025 14:37
@TheOneRing
TheOneRing merged commit 2b18581 into main Aug 7, 2025
@TheOneRing
TheOneRing deleted the work/move branch August 7, 2025 14:57
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.

Windows VFS: Prevent move of dehydrated placeholder to excluded folder

2 participants