Fix Google Docs integration breaking when cancelling edit bibliograpy

I've run into this randomly. It only occurs if the first operation on a
Google Doc since Zotero restart is the edit bibliography dialog which
you cancel. Due to how the HTTP integration client is implemented, the
missing await causes it to try to send another response to the Connector
(which is no longer waiting on the /response endpoint), failing and
causing a forever pending promise, which makes subsequent attempts to
interact with the Google Docs plugin no-op.

We get occassional reports from users about Google Docs getting stuck
that is fixed by Zotero restart, so hopefully this will reduce those.
This commit is contained in:
Adomas Venčkauskas 2025-08-05 09:55:09 +03:00 committed by Dan Stillman
parent 42ff572a6d
commit 76c0c9d0ce

View file

@ -304,7 +304,7 @@ Zotero.Integration = new function() {
await document.setDocumentData(session.data.serialize()); await document.setDocumentData(session.data.serialize());
// And any citations marked for processing (like retraction warning ignore flag changes) // And any citations marked for processing (like retraction warning ignore flag changes)
if (Object.keys(session.processIndices).length) { if (Object.keys(session.processIndices).length) {
session.updateDocument(FORCE_CITATIONS_FALSE, false, false); await session.updateDocument(FORCE_CITATIONS_FALSE, false, false);
} }
// Since user cancelled we can ignore if processor fails here. // Since user cancelled we can ignore if processor fails here.
} catch(e) {} } catch(e) {}