-
-
Notifications
You must be signed in to change notification settings - Fork 978
Fix empty files not being able to be shared #3895
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Milen Pivchev <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]> Signed-off-by: Milen Pivchev <[email protected]>
|
#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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EXTENSION_FILE_PROVIDER_EXTENSION
Signed-off-by: Milen Pivchev <[email protected]>
Done, please recheck |
Signed-off-by: Milen Pivchev <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.