Open escowles opened 5 years ago
We recently made PDFs serve in the case of an optimistic lock error. We could just generalize that to rescue everything, or we could figure out what the error would be in read-only and add that specifically.
https://github.com/pulibrary/figgy/commit/500bda231dd02bbf1ba2fb7823a3731d4c58e18c
@hackartisan @tpendragon @eliotjordan @Seanwarren77 @sdellis - can we get this on a workcycle board in the next 3-6 weeks?
Reasoning: while not a sudden priority that is blocking the most recent need for Figgy Upgrade now, it would be incredibly helpful to our colleagues in SC/Mudd to have this implemented before the next read only moment for figgy.
This probably isn't working as implemented. The file that gets returned from the generator doesn't have the pdf attached to it, so it's likely showing a 404 now instead of a 500.
One idea is to store the generated pdfs at a known location with a predictable title (maybe the resource id sent to the generation job), and then have the download controller look in that location if it's not found on the resource.
As part of working this ticket, update or replace the skipped tests in spec/requests/scanned_resource_spec
.
Currently, PDFs are generated, attached to the resource, and then users are forwarded to the download URL for the new file. In read-only mode, this won't work, because we can't attach the generated PDF.
We should be able to generate a PDF and just send it to the user instead of attaching/redirecting.
Implementation
PDFs should not store on
file_metadata
, instead it should store in a known cache location.To do this:
We're going to prioritize this ticket around the next time we need to go into read only mode.