From ca31a181595fa57d8ec10a3266085a8d716f593e Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 13 Feb 2010 09:45:29 +0000 Subject: [PATCH] Auto-correct most (if not all) cases of "Unexpected status 404 in Zotero.Sync.Storage.Session.ZFS._getFileUploadParameters()" --- chrome/content/zotero/xpcom/storage/zfs.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js index 30b70e116..a35e33abf 100644 --- a/chrome/content/zotero/xpcom/storage/zfs.js +++ b/chrome/content/zotero/xpcom/storage/zfs.js @@ -533,6 +533,22 @@ Zotero.Sync.Storage.Session.ZFS.prototype._getFileUploadParameters = function (i self.onError(e); return; } + else if (req.status == 404) { + Components.utils.reportError("Unexpected status code 404 in " + funcName + + " (" + Zotero.Items.getLibraryKeyHash(item) + ")"); + if (Zotero.Prefs.get('sync.debugNoAutoResetClient')) { + Components.utils.reportError("Skipping automatic client reset due to debug pref"); + return; + } + if (!Zotero.Sync.Server.canAutoResetClient) { + Components.utils.reportError("Client has already been auto-reset -- manual sync required"); + return; + } + Zotero.Sync.Server.resetClient(); + Zotero.Sync.Server.canAutoResetClient = false; + self.onError(); + return; + } else if (req.status != 200) { var msg = "Unexpected status code " + req.status + " in " + funcName + " (" + Zotero.Items.getLibraryKeyHash(item) + ")";