scientist-softserv / iiif_print

A gem for Hyrax/Samvera for displaying PDF pages in a IIIF Compliant viewer
Apache License 2.0
4 stars 1 forks source link

:bug: Universal Viewer locks web container in local dev environment #348

Open laritakr opened 2 months ago

laritakr commented 2 months ago

Story

When in the local dev environment, you cannot visit a show page for a work that uses the universal viewer. The web container totally freezes, and requires a stop and restart.

As a workaround for hyku, you can:

To duplicate the problem, fire up the hyku application for local development.

Acceptance Criteria

Notes

aprilrieger commented 2 months ago

Well I chased it down to here:

config.iiif_info_url_builder = lambda do |file_id, base_url|
    uri = Riiif::Engine.routes.url_helpers.info_url(file_id, host: base_url)
    uri = uri.sub(%r{/info\.json\Z}, '')
    # Comment this next line to allow universal viewer to work in development
    # Issue with Hyrax v 2.9.0 where IIIF has mixed content error when running with SSL enabled
    # See Samvera Slack thread https://samvera.slack.com/archives/C0F9JQJDQ/p1596718417351200?thread_ts=1596717896.350700&cid=C0F9JQJDQ
    uri.sub(/\Ahttp:/, 'https:')
  end

Screenshot 2024-04-22 at 23 44 11

aprilrieger commented 2 months ago

@laritakr and I were talking about this in a DM so moving here for visibility, @kirkkwang LaRita was wondering if:

That’s amazing! So happy to have progress in tracing it.
Kirk does this mean anything to you? Curious if you have any ideas on a permanent workaround.
Screenshot 2024-04-23 at 20 31 40
kirkkwang commented 2 months ago

Thanks for chasing it down @aprilrieger, this doesn't ring a bell right away but I'll have to look into the riiif gem itself at that controller to see what's going on. Still very strange that this happens locally but not in a deployed environment. I was chasing it down to https://github.com/sul-dlss/riiif/blob/main/app/transformers/riiif/abstract_transformer.rb#L20 which then led to here https://github.com/sul-dlss/riiif/blob/main/app/services/riiif/imagemagick_command_factory.rb#L29-L43 and then finally this spot was the last point before stalling https://github.com/sul-dlss/riiif/blob/main/app/services/riiif/imagemagick_command_factory.rb#L82-L85. Hopefully we can link up tomorrow or so and compare notes and knock this one out.