Issue 45708: Exported Notebooks include embedded attachments for all previous versions of each entry

issues
Status:closed
Assigned To:Guest
Type:Defect
Area: 
Priority:3
Milestone:22.07
Opened:2022-06-16 14:22 by alanv
Changed:2022-06-30 12:00 by hannahb
Resolved:2022-06-23 10:31 by alanv
Resolution:Fixed
Related:45688
Support Ticket: 
Pull Requests:labbook#216
Closed:2022-06-30 12:00 by hannahb
Related Issues
2022-06-16 14:22 alanv
Title»Exported Notebooks include embedded attachments for all previous versions of each entry
Assigned To»triage
Type»Defect
Priority»3
Milestone»22.07
Related»45688
1. Create a Notebook
2. Embed several large images into the entry (on OS X go to an image in finder, CMD + C the image, then go to the entry and hit CMD + V). These files must collectively be greater than 50MB
3. Wait at least 5 minutes, then remove the images from the entry
4. Submit the notebook
5. Approve the notebook

Expected Results: The notebook is approved
Actual Results: Notebook approval fails when generating the signed snapshot, and the same type of error as previously reported is rendered.

This case is especially confounding because to the user there are no attachments. What we are doing is exporting all embedded images associated with each entry's wiki, even if they're not associated with the most recent version of an entry. Instead, what we should be doing is only exporting embedded attachments associated with the most recent wiki version of each entry.

We'll want to do two things:

1. Add a method to RemirroDocumentProcessor, getEmbeddedAttachmentFiles, that gets all AttachmentFiles for a given entry
2. Add a new method to NoteobokWriter called writeEmbeddedAttachments and replace the call to writeAttachments that passes "inlineAttachments" as true. This method will use the getEmbeddedAttachmentFiles from RemirrorDocumentProcessor to get the list of AttachmentFiles, then it will write them like we do in the current writeAttachments method.

2022-06-22 11:41 alanv
Pull Requests»https://github.com/LabKey/labbook/pull/216

2022-06-23 09:51 Nick Kerr
Assigned Totriage»alanv

2022-06-23 10:32 alanv
resolve as Fixed
Statusopen»resolved
Assigned Toalanv»hannahb
Merged

2022-06-30 12:00 hannahb
close
Statusresolved»closed
Assigned Tohannahb»Guest
Verified