VR-5185 Commit reuploads versioned blobs everytime it is saved #963
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.
On top of #962.
@conradoverta I found a new bug that I didn't think of before: Every time the commit saves, it attempts to reupload the blobs that were previously designated to enableMDBVersioning, even though user does not update that blob.
This is because unlike the Python client, I used the flag enableMDBVersioning for both upload-able and download-able check.
This is wrong; a blob might be downloadable, but no need to be uploaded when the commit is saved (as it has been uploaded before, and there is no update since).
The solution is to decouple these two states. I add another (immutable) field called downloadable, which is a user-friendly name for internal_versioned_path.isDefined.
I've also updated one of the tests, which would now fail under my old implementation, but pass under my new implementation.