Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep both conflict #9915

Merged
merged 4 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/bugfix-keep-both-conflict
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Keep both folders conflict in same-named folders

Parsing has been adjusted to account for edge case of multiple folders and sub-folders with the same name

https://github.com/owncloud/web/pull/9915
https://github.com/owncloud/web/issues/9158
6 changes: 3 additions & 3 deletions packages/web-app-files/src/helpers/resource/actions/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,18 @@ export class ResourceConflict extends ConflictDialog {
`/${newFolderName}/`
)
file.meta.tusEndpoint = file.meta.tusEndpoint.replace(
new RegExp(`/${encodeURIComponent(folder)}`),
new RegExp(`/${encodeURIComponent(folder)}$`),
`/${encodeURIComponent(newFolderName)}`
)
if (file.xhrUpload?.endpoint) {
file.xhrUpload.endpoint = file.xhrUpload.endpoint.replace(
new RegExp(`/${encodeURIComponent(folder)}`),
new RegExp(`/${encodeURIComponent(folder)}$`),
`/${encodeURIComponent(newFolderName)}`
)
}
if (file.tus?.endpoint) {
file.tus.endpoint = file.tus.endpoint.replace(
new RegExp(`/${encodeURIComponent(folder)}`),
new RegExp(`/${encodeURIComponent(folder)}$`),
`/${encodeURIComponent(newFolderName)}`
)
}
Expand Down