allow most recent version of file to be downloaded. #4336
Merged
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.
Fixes #4274
When a depositor or an admin wants to add a new version of a file, they download the file, edit it and upload it back as a new version. After uploading the new version, they download it to check it. Before this change, hyrax downloaded the old version. After this PR, it downloads the most recent change.
The reason this was happening was because date_modified was not being updated when a new version was being uploaded. The call to
update_metadata
ensures that the modified_date is updated. This date is used to build the header when downloading, specifically theLast-Modified
portion of the header. The browser then knows that when this date has changed, it does not use the cache.Guidance for testing, such as acceptance criteria or new user interface behaviors:
@samvera/hyrax-code-reviewers