Skip to content

Fix workspace file/folder name path cleaning#1857

Merged
AaronPlave merged 1 commit into
developfrom
fix/workspace-path-cleaning-bug-fix
Jan 26, 2026
Merged

Fix workspace file/folder name path cleaning#1857
AaronPlave merged 1 commit into
developfrom
fix/workspace-path-cleaning-bug-fix

Conversation

@AaronPlave
Copy link
Copy Markdown
Contributor

@AaronPlave AaronPlave commented Jan 21, 2026

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

  1. Create a workspace with parentheses in the name like "Workspace (a)"
  2. Open the workspace and click the plus button and click on new file
  3. Create a file in the root called "foo.txt"
  4. Ensure the file is created at the root and not in "Workspace (a)/foo.txt"
  5. Repeat 1-4 within a folder in the workspace
  6. Repeat 1-5 for folder creation
  7. Ensure move workspace file/folder and import workspace file function normally

@AaronPlave AaronPlave requested a review from a team as a code owner January 21, 2026 17:52
@AaronPlave AaronPlave self-assigned this Jan 21, 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.
@AaronPlave AaronPlave force-pushed the fix/workspace-path-cleaning-bug-fix branch from 8faf0ad to 519628f Compare January 26, 2026 23:07
@AaronPlave AaronPlave merged commit 4688e36 into develop Jan 26, 2026
5 checks passed
@AaronPlave AaronPlave deleted the fix/workspace-path-cleaning-bug-fix branch January 26, 2026 23:40
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.

Phoenix creates extra folder when uploading file

3 participants