Skip to content

Conversation

@JammingBen
Copy link
Contributor

@JammingBen JammingBen commented Nov 17, 2025

Fixes the "Replace" option of the conflict dialog when moving one folder into another.

The issue was the edge case check if a user moves a subfolder with the same name as the current folder into the parent of the current folder. I just added another check to ensure this only happens when moving a folder up in the hierarchy.

fixes #1617

Fixes the "Replace" option of the conflict dialog when moving one folder into another.
@JammingBen JammingBen self-assigned this Nov 17, 2025
Copilot AI review requested due to automatic review settings November 17, 2025 14:23
Copy link
Contributor

Copilot AI left a comment

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 fixes the "Replace" option in the conflict dialog when moving folders. The fix addresses an issue where moving a folder into another folder would incorrectly detect a naming clash with a parent folder.

Key Changes:

  • Added path validation logic to prevent false positive parent folder overwrite detection
  • Updated test to be synchronous and properly mock the current folder resource
  • Added edge case handling for upward folder moves in the hierarchy

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/web-pkg/src/helpers/resource/conflictHandling/transfer.ts Added null check for current folder path and logic to handle edge case where folders are moved upward in hierarchy
packages/web-pkg/tests/unit/helpers/resource/conflictHandling/resourcesTransfer.spec.ts Updated test to be synchronous, added path property to mocked resource, and removed async/await from function calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JammingBen JammingBen requested a review from kulmann November 17, 2025 14:37
@tammi-23 tammi-23 self-requested a review November 21, 2025 09:39
Copy link
Contributor

@tammi-23 tammi-23 left a comment

Choose a reason for hiding this comment

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

👍 great, works as expected

@kulmann kulmann merged commit 1366603 into main Nov 21, 2025
29 checks passed
@kulmann kulmann deleted the fix/move-folder-replace branch November 21, 2025 14:04
@kulmann
Copy link
Contributor

kulmann commented Nov 21, 2025

💚 All backports created successfully

Status Branch Result
stable-4.2

Questions ?

Please refer to the Backport tool documentation

openclouders pushed a commit that referenced this pull request Nov 21, 2025
@openclouders openclouders mentioned this pull request Nov 21, 2025
1 task
@openclouders openclouders mentioned this pull request Dec 15, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move folder with replace fails

4 participants