Fix empty files not being able to be shared#3895
Conversation
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where empty files (0 bytes) could not be shared because the fileProviderStorageExists method incorrectly rejected files with zero size. The fix removes the && metadata.size > 0 condition from the file existence checks.
Key Changes:
- Removed the
metadata.size > 0check from two return statements in thefileProviderStorageExistsmethod - Now allows empty files (0 bytes) to be recognized as valid for sharing
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
|
#if EXTENSION_FILE_PROVIDER_EXTENSION Must exists because in FILE_PROVIDER_EXTENSION I'm not sure of the effects |
marinofaggiana
left a comment
There was a problem hiding this comment.
EXTENSION_FILE_PROVIDER_EXTENSION
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Done, please recheck |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
An empty .md or .txt is 0 bytes, and the check if the file exists in the document storage expects the size of the file to be > 0. This removes the check, which allows a 0 byte file to be shared.
@marinofaggiana do you think this is a dangerous solution? I haven't noticed any issues so far. I think all the other checks we do to make sure the file exists are enough.