Skip to content

Comments

Refactor dehydrate file#193

Merged
dajimenezriv-internxt merged 34 commits intomasterfrom
refactor-dehydrate-file
Sep 18, 2025
Merged

Refactor dehydrate file#193
dajimenezriv-internxt merged 34 commits intomasterfrom
refactor-dehydrate-file

Conversation

@dajimenezriv-internxt
Copy link
Contributor

@dajimenezriv-internxt dajimenezriv-internxt commented Sep 17, 2025

No description provided.

@dajimenezriv-internxt dajimenezriv-internxt self-assigned this Sep 17, 2025
@dajimenezriv-internxt dajimenezriv-internxt changed the base branch from master to template-args September 17, 2025 12:02
Base automatically changed from template-args to master September 18, 2025 15:15
@@ -0,0 +1,39 @@
#include <windows.h>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Code is nearly the same.

  1. We check if it's a directory, in that case we throw an exception. Previously we were just ignoring it.
  2. We remove the check of a file has the attribute FILE_ATTRIBUTE_UNPINNED since the error given by CfDehydratePlaceholder is better: [DehydrateFileWrapper] WinRT error: The operation cannot be performed on pinned cloud files. (HRESULT: 0x80070188).
  3. We keep the mssage box in case the file is used in that moment and we cannot dehydrate.
  4. We throw the exception to let the javascript code know that something failed.

I've tested these three possible errors and all work perfectly.

LARGE_INTEGER length;
GetFileSizeEx(placeholder.get(), &length);

if (attrib & FILE_ATTRIBUTE_UNPINNED)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We neo longer need to check this manually, the error given by CfDehydratePlaceholder is better as explained below.

@dajimenezriv-internxt dajimenezriv-internxt merged commit b1fa12b into master Sep 18, 2025
1 check passed
@dajimenezriv-internxt dajimenezriv-internxt deleted the refactor-dehydrate-file branch September 18, 2025 18:04
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.

2 participants