www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit e45ee36117b2c5fdb4d84db539dede53aba73171
parent 6a9b372e66a38c4f46e9c6e5d9b30019eafe7e66
Author: Dan Stillman <dstillman@zotero.org>
Date:   Sat, 15 Nov 2008 20:26:36 +0000

Fix invalid progress values due to Firefox bug (fixed in 3.1)


Diffstat:
Mchrome/content/zotero/xpcom/storage.js | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js @@ -2068,6 +2068,13 @@ Zotero.Sync.Storage = new function () { + "_Zotero.Sync.Storage._updateProgress()"); } + // Workaround for invalid progress values (possibly related to + // https://bugzilla.mozilla.org/show_bug.cgi?id=451991 and fixed in 3.1) + if (progress < r.progress) { + //Zotero.debug("Invalid progress (" + progress + " < " + r.progress + ")"); + return; + } + _totalProgress[queue] += progress - r.progress; r.progress = progress; @@ -2336,6 +2343,11 @@ Zotero.Sync.Storage.StreamListener.prototype = { // nsIProgressEventSink onProgress: function (request, context, progress, progressMax) { + // Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=451991 + // (fixed in Fx3.1) + if (progress > progressMax) { + progress = progressMax; + } //Zotero.debug("onProgress with " + progress + "/" + progressMax); this._onProgress(request, progress, progressMax); },