Bug: "undefined Attachment" error when saving multiple items via COinS
Hi,
I've found a bug when saving multiple items from pages using COinS metadata. Selecting multiple items shows "undefined Attachment" errors and fails with Failed to construct 'URL': Invalid URL in the console.
Steps to reproduce:
1. Go to https://datasweep.app/chat
2. Pick one of the 4 predefined searches; log in
3. After the summary is fully streamed in and the articles are loaded, the Zotero Connector detects the articles cited on this page
4. Click the Zotero button -> select multiple items -> save
Progress window shows "undefined Attachment" errors
Single-item saves work fine. The issue is that COinS doesn't provide attachment URLs, so when processing multiple items, the connector tries to handle attachments with undefined url and mimeType properties.
Environment: Connector 5.0.193, Chrome/Firefox, Zotero 7.0.32, macOS
I've submitted a PR with a fix that adds defensive checks to skip attachments without valid URLs:
https://github.com/zotero/zotero-connectors/pull/597
The fix filters out invalid attachments early and handles undefined mimeTypes gracefully, while still allowing the Open Access resolver to find PDFs.
Thanks!
I've found a bug when saving multiple items from pages using COinS metadata. Selecting multiple items shows "undefined Attachment" errors and fails with Failed to construct 'URL': Invalid URL in the console.
Steps to reproduce:
1. Go to https://datasweep.app/chat
2. Pick one of the 4 predefined searches; log in
3. After the summary is fully streamed in and the articles are loaded, the Zotero Connector detects the articles cited on this page
4. Click the Zotero button -> select multiple items -> save
Progress window shows "undefined Attachment" errors
Single-item saves work fine. The issue is that COinS doesn't provide attachment URLs, so when processing multiple items, the connector tries to handle attachments with undefined url and mimeType properties.
Environment: Connector 5.0.193, Chrome/Firefox, Zotero 7.0.32, macOS
I've submitted a PR with a fix that adds defensive checks to skip attachments without valid URLs:
https://github.com/zotero/zotero-connectors/pull/597
The fix filters out invalid attachments early and handles undefined mimeTypes gracefully, while still allowing the Open Access resolver to find PDFs.
Thanks!
Upgrade Storage