Remove the condition to handle files size 0 separately #401
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
if the size of a file is 0, we should handle it differently. One main problem with the earlier approach was that, if there was an file with content (lets call this version of the file V1) and it was uploaded the file would be searchable and downloadable. Lets say the user removes the content of the file (lets call this version of the file V2), and the file that was accessible earlier should no longer be accessible. i.e. V1 should not be accessible and V2 should be accessible
With the old code, the problem would be that the reference to the file with content is not removed so even though the file is updated on CDF you can still access the original file (V1) and even download it. Based on the discussions on slack, we should not make any decisions as an extractor depending on the size or content of the file. So if a client/user has removed the content of the file we should look at it as an update and just upload the new empty file.
With this approach we would essentially be uploading an empty file and hence the file accessible on the UI will be V2.