Skip to content

Fix deep subfolder scanning failing silently#75

Open
trek-e wants to merge 2 commits intorubenwe:masterfrom
trek-e:fix/resilient-subfolder-scanning
Open

Fix deep subfolder scanning failing silently#75
trek-e wants to merge 2 commits intorubenwe:masterfrom
trek-e:fix/resilient-subfolder-scanning

Conversation

@trek-e
Copy link
Copy Markdown

@trek-e trek-e commented Jan 23, 2026

Summary

Changes

  • Added GetFilesResilient() method with per-directory exception handling
  • Catches UnauthorizedAccessException and PathTooLongException specifically
  • Logs warnings for inaccessible paths but continues scanning
  • Falls back to generic exception handling for unexpected errors

Test plan

  • Import folder with deep nesting (5+ levels)
  • Import folder containing inaccessible subdirectories
  • Import folder with paths >260 characters (Windows)
  • Verify warnings logged for skipped directories

🤖 Generated with Claude Code

trek-e and others added 2 commits January 23, 2026 18:39
- STACK.md - Technologies and dependencies
- ARCHITECTURE.md - System design and patterns
- STRUCTURE.md - Directory layout
- CONVENTIONS.md - Code style and patterns
- TESTING.md - Test structure
- INTEGRATIONS.md - External services
- CONCERNS.md - Technical debt and issues
Fixes rubenwe#52, rubenwe#73

Directory.GetFiles with SearchOption.AllDirectories throws and returns
nothing when ANY subdirectory is inaccessible (permissions, symlinks,
long paths). This broke recursive scanning for users with large nested
folder structures.

Replace with GetFilesResilient() that:
- Handles exceptions per-directory instead of failing the entire scan
- Catches UnauthorizedAccessException and PathTooLongException specifically
- Logs warnings for inaccessible paths but continues scanning
- Continues to discover files in accessible directories

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

Import doesn't seem to scan deep subfolders

1 participant