Skip to content
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

Use a hashed version identifier in IIIF manifest #6368

Merged
merged 2 commits into from
Oct 19, 2023
Merged

Conversation

dlpierce
Copy link
Contributor

Fixes

Fixes #6352

Summary

Ensures the IIIF server can discern outdated image data in the event of a file revision.

Guidance for testing, such as acceptance criteria or new user interface behaviors:

  • After uploading a new version of a file to a file set, the updated image is displayed in the viewer.

Details

Despite its name, the Riiif::HttpFileResolver was capable of opening files available on a local filesytem. In doing so it would create its own copy of the file based on the id less any version data. In the event of a file revision, the cached file could not be easily cleared.

This prompted a new resolver that interfaces with valkyrie storage adapters more directly. This avoids the extraneous file copy, and attempts to prevent riiif from transforming files that have not finished copying via a Concurrent::ReadWriteLock.

The version portion of the image identifiers in the IIIF manifest is hashed to avoid potentially overly verbose version strings.

Changes proposed in this pull request:

  • Add RiiifFileResolver and RiiifFile to more efficiently use riiif with valkyrie storage adapters. Uses a read/write lock when loading a local file copy from storage.
  • Rerun characterization/derivatives when reverting a file version.
  • Include version in solr indexed original_file_id. This is now generated by Hyrax::FileSet#iiif_id instead of by the file set indexer.
  • Patch Valkyrie's StreamFile #length in same manner as done for ::File.
  • Set json content type for manifest response. (Browsers should render a pretty version of them now)
  • The :test_disk storage adapter for specs is now a VersionedDisk adapter.

Ensures the IIIF server can discern outdated image data in the event of a file revision.

Summary of changes:
- Add RiiifFileResolver and RiiifFile to more efficiently use riiif with valkyrie storage adapters. Uses a read/write lock when loading a local file copy from storage.
- Rerun characterization/derivatives when reverting a file version.
- Include version in solr indexed original_file_id. This is now generated by Hyrax::FileSet#iiif_id instead of in the indexer.
- Patch valkyrie StreamFile length in same manner as ::File.
- Set json content type for manifest response.
- The :test_disk storage adapter for specs is now a VersionedDisk adapter.
@dlpierce dlpierce added notes-minor Release Notes: Non-breaking features notes-valkyrie Release Notes: Valkyrie specific labels Oct 19, 2023
@abelemlih abelemlih merged commit 7b77419 into main Oct 19, 2023
4 checks passed
@abelemlih abelemlih deleted the versioned_riiif branch October 19, 2023 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notes-minor Release Notes: Non-breaking features notes-valkyrie Release Notes: Valkyrie specific
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to restore previous version of a fileset on pg.nurax
2 participants