From 1cc03492c4246f1b653951bcfe27ec7fdfda39a1 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 1 Mar 2022 05:08:36 -0500 Subject: [PATCH] Split annotations on sync error Follow-up to b7f26c47c1 --- chrome/content/zotero/xpcom/sync/syncEngine.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chrome/content/zotero/xpcom/sync/syncEngine.js b/chrome/content/zotero/xpcom/sync/syncEngine.js index fd2bf17513..e0806a5e28 100644 --- a/chrome/content/zotero/xpcom/sync/syncEngine.js +++ b/chrome/content/zotero/xpcom/sync/syncEngine.js @@ -2076,6 +2076,12 @@ Zotero.Sync.Data.Engine.prototype._checkObjectUploadError = Zotero.Promise.corou } } } + + // Split old annotations before we were splitting them automatically in the PDF reader + if (message == "Annotation position is too long") { + let item = Zotero.Items.getByLibraryAndKey(this.libraryID, key); + yield Zotero.Annotations.splitAnnotations(item); + } } else if (code == 403) { // If we get a 403 for a local group attachment, check the group permissions to confirm