Fix workspace file/folder name path cleaning#1857
Merged
Merged
Conversation
duranb
approved these changes
Jan 26, 2026
…n various workspace modals to avoid issues with unescaped filenames interferring with regexes to remove the workspace path. Additionally, trim the end of filenames to remove trailing spaces.
8faf0ad to
519628f
Compare
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.
A regex was being used to remove the workspace path from the filepath in various workspace file/folder create/move modals. This regex failed on workspace names with various characters like parentheses, brackets, etc., that were not being escaped and were therefore being incorporated into the regex string. The resulting filepath for something like "Workspace (A)/foo.txt" would be "Workspace (A)/foo.txt" instead of just "foo.txt", causing a folder with the workspace name to be errantly created during file creation. This PR switches the approach to just remove the first path in the filePath instead of using a regex. Additionally, this PR removes trailing spaces from the end of these filePaths since those also caused creation failures. This should close #1781 which may have also been due to a backend bug that no longer exists - this should resolve all known cases of the issue.
Verification