Fix: Handle 409 "File already exists" conflict during file upload in SyncExtension#202
Fix: Handle 409 "File already exists" conflict during file upload in SyncExtension#202patricioxavier8 wants to merge 1 commit intomainfrom
Conversation
…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.
There was a problem hiding this comment.
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. |
When
createFileNewreturns a 409 conflict, instead of failing, recover the existingfile using
getExistenceFileInFolderByPlainName+getFileMetaByUuidand return itas a successful
FileProviderItem.