[ENG-11727] Corrupted file versions are unpreviewable, undownloadable, and undeletable#11820
Open
mkovalua wants to merge 3 commits into
Open
[ENG-11727] Corrupted file versions are unpreviewable, undownloadable, and undeletable#11820mkovalua wants to merge 3 commits into
mkovalua wants to merge 3 commits into
Conversation
…to return single file version
mkovalua
marked this pull request as draft
July 20, 2026 14:12
mkovalua
marked this pull request as ready for review
July 21, 2026 15:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ticket
Purpose
A pattern of file version corruption has emerged across multiple projects. After a new version is uploaded, the file becomes unpreviewable, undownloadable, and impossible to delete — by the user and by support. Uploading additional versions doesn't fix it; metadata updates (date modified) but the file remains unretrievable. The broken versions are stuck and block users from recovering a working file.
Looks like what’s happening is if you check https://api.osf.io/v2/files/f42sc/ and look at its file versions https://api.osf.io/v2/files/697ec8ac74e08d03dccd76ea/versions/ we have multiple version 2s of the same file that seem identical but have a sliiightly different date_created, and that's causing problems with the system. We need to prevent that from happening and clean the data for the existing issues.
Changes
make create_version to avoid file version duplicates and get_version to return single file version;
create management command to dedupe (delete file versions duplicates);
Side Effects
QE Notes
CE Notes
Documentation