You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR refactors createFileStructure in helpers.js to unify path creation logic across all storage types using an ensureEntry helper, and updates openFolder.js to detect nested paths and trigger a full folder reload instead of individual tile appends.
Key strengths:
Proper error handling: createNew is wrapped in try/catch/finally so stopLoading() is always called and errors surface via helpers.error()
Nested-path detection correctly triggers reload() + FileList.refresh() for multi-segment paths
Critical regression:
When a single-segment path references an existing entry with matching type (e.g., trying to create a file that already exists), the refactored ensureEntry returns a valid object with created: false. The guard at line 676 (if (!newUrl) return;) no longer catches this case, allowing the code to proceed and append the existing entry as a duplicate tile to the expanded folder view, along with a misleading success toast. This is a breaking change from the previous behavior where undefined was returned and the caller exited early.
Confidence Score: 2/5
Not safe to merge as-is — a logic regression silently adds duplicate entries to the folder UI when attempting to create a same-named file or folder that already exists.
The regression identified is a real functional bug that breaks expected behavior for a common use case (user attempts to create a file/folder with a name that already exists in the current folder). The fix is straightforward (check newUrl.created before appending) but the issue must be resolved before merging.
src/lib/openFolder.js — the duplicate-appending regression must be fixed by checking newUrl.created in the guard at line 676.
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
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.
Fixes: #1745