Skip to content

Conversation

@phmatray
Copy link
Contributor

Fix the known issue with directory rename operations to ensure they work correctly across all scenarios including nested directories and files.

phmatray and others added 11 commits January 23, 2026 16:25
Verified that DirectoryRenamed event invocation already correctly passes
the new path parameter. Code at VFS.Rename.cs line 96 matches the
VFSDirectoryRenamedArgs constructor signature perfectly.

Build verification: Succeeded with 0 errors.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…aths

Verified that redo logic at line 180 in ChangeHistory.cs is already correct:
- Uses directoryRenamed.Path (old path where directory is after undo)
- Uses directoryRenamed.NewName to rename forward
- This correctly recreates the original rename operation

Flow verification:
1. Original: /dir1 -> /dir2 (directory at /dir2)
2. Undo: Uses NewPath (/dir2) to rename to OldName -> directory at /dir1
3. Redo: Uses Path (/dir1) to rename to NewName -> directory back at /dir2

No code changes needed - implementation already correct.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…y nested structure

Added comprehensive test RenameDirectory_handles_deeply_nested_structure() that verifies:
- Creates deeply nested structure /a/b/c/d/e with files at each level
- Creates subdirectories at different levels
- Renames a middle directory and verifies all nested paths are updated correctly
- Verifies file contents are preserved
- Verifies file and directory Path properties are correctly updated
- Total of 11 RenameDirectory tests now passing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Verification Results:
- 25 rename-specific tests: ALL PASSED
- Total test results: 379 passed, 4 pre-existing failures (locale-related)
- No regressions introduced by directory rename fix

The 4 failures are in VFSBinaryExtensionsTests (decimal separator formatting)
and are completely unrelated to the rename operation implementation.

All directory rename functionality verified:
✓ Basic rename operations
✓ Nested file path updates
✓ Deeply nested structures
✓ Event args with correct paths
✓ Undo/redo operations
✓ Edge case and error handling

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…a-requested)

Fixes:
- Add duplicate directory check in VFS.Rename.cs before rename operation
- Add test to verify exception is thrown when renaming to existing name

Verified:
- Validation follows same pattern as CreateDirectory duplicate check
- Test matches pattern from existing duplicate validation tests
- Fixes acceptance criteria #5: renaming to existing name throws exception

QA Fix Session: 1

Co-Authored-By: Claude Sonnet 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.

2 participants