Fix unreliable cloud placeholder file detection#4
Open
WayneKoorts wants to merge 2 commits intomasterfrom
Open
Fix unreliable cloud placeholder file detection#4WayneKoorts wants to merge 2 commits intomasterfrom
WayneKoorts wants to merge 2 commits intomasterfrom
Conversation
Owner
WayneKoorts
commented
Dec 8, 2025
- Add missing Windows file attribute constants (RECALL_ON_OPEN, SPARSE_FILE, REPARSE_POINT)
- Fix verbose output bug that displayed wrong attribute name (showed RECALL_ON_DATA_ACCESS as "Pinned")
- Rewrite hydration status detection logic:
- DEHYDRATED: File has RECALL_ON_DATA_ACCESS or RECALL_ON_OPEN (placeholder needing data)
- HYDRATING: File has recall attribute AND PINNED (actively downloading)
- HYDRATED: File has no recall attributes (data locally available)
- Fix operator precedence bug in original hydrating detection
- Improve cloud file detection to use RECALL_ON_OPEN attribute
- Add internal methods for testability (DetermineHydrationStatusFromAttributes, DeterminePinStatusFromAttributes)
- Add unit test project with comprehensive tests for hydration and pin status detection
- Add missing Windows file attribute constants (RECALL_ON_OPEN, SPARSE_FILE, REPARSE_POINT) - Fix verbose output bug that displayed wrong attribute name (showed RECALL_ON_DATA_ACCESS as "Pinned") - Rewrite hydration status detection logic: - DEHYDRATED: File has RECALL_ON_DATA_ACCESS or RECALL_ON_OPEN (placeholder needing data) - HYDRATING: File has recall attribute AND PINNED (actively downloading) - HYDRATED: File has no recall attributes (data locally available) - Fix operator precedence bug in original hydrating detection - Improve cloud file detection to use RECALL_ON_OPEN attribute - Add internal methods for testability (DetermineHydrationStatusFromAttributes, DeterminePinStatusFromAttributes) - Add unit test project with comprehensive tests for hydration and pin status detection
- Add Cloud Filter API P/Invoke declarations (cldapi.dll) - Add CF_PLACEHOLDER_STATE enum with all placeholder state flags - Add GetAttributesAndReparseTag method to get file attributes and reparse tag - Add GetPlaceholderState method to query Cloud Filter API - Add IsCloudPlaceholder and IsFullyHydrated helper methods - Update GetHydrationStatus to use CF API as primary detection method with automatic fallback to attribute-based detection - Add DetermineHydrationStatusFromPlaceholderState for CF API-based detection - Improve verbose output to show placeholder state flags - Add comprehensive unit tests for placeholder state detection The Cloud Filter API provides more authoritative detection: - PARTIAL and PARTIALLY_ON_DISK flags directly indicate hydrating state - No longer need to infer hydration from PINNED + RECALL combination - Graceful fallback when cldapi.dll is not available (older Windows)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.