Skip to content

Fix: Handle 409 "File already exists" conflict during file upload in SyncExtension#202

Open
patricioxavier8 wants to merge 1 commit intomainfrom
fix/handle-409-file-already-exists-on-upload
Open

Fix: Handle 409 "File already exists" conflict during file upload in SyncExtension#202
patricioxavier8 wants to merge 1 commit intomainfrom
fix/handle-409-file-already-exists-on-upload

Conversation

@patricioxavier8
Copy link
Contributor

When createFileNew returns a 409 conflict, instead of failing, recover the existing
file using getExistenceFileInFolderByPlainName + getFileMetaByUuid and return it
as a successful FileProviderItem.

…tadata

When createFileNew returns a 409 "File already exists" error, recover
by querying the existing file via getExistenceFileInFolderByPlainName
and fetching full metadata with getFileMetaByUuid, then returning
the existing FileProviderItem to Finder instead of failing.
@patricioxavier8 patricioxavier8 requested a review from sg-gs as a code owner March 4, 2026 17:12
@patricioxavier8 patricioxavier8 self-assigned this Mar 4, 2026
Copy link
Member

@sg-gs sg-gs left a comment

Choose a reason for hiding this comment

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

The 409 indicates that the file name is already in use inside that folder. But the content could be different, because the user could be attempting to replace the file, or is that a different situation in this context @patricioxavier8 ?

@patricioxavier8
Copy link
Contributor Author

The 409 indicates that the file name is already in use inside that folder. But the content could be different, because the user could be attempting to replace the file, or is that a different situation in this context @patricioxavier8 ?

This is a different scenario. While the validation you mentioned occurs earlier, the user reports that the file is not visible and cannot be deleted because it appears not to exist. This change introduces a fallback to handle those cases and avoid related errors.

Base automatically changed from release/2.6.4 to main March 9, 2026 19:44
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.

2 participants