Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #20988 from mcav/gelam-epoch
Browse files Browse the repository at this point in the history
Bug 941991 - [Email] Sync falls into the epoch. r=jrburke
  • Loading branch information
mcav authored and rvandermeulen committed Jun 26, 2014
1 parent df7005b commit 2f60002
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions apps/email/js/ext/mailapi/worker-bootstrap.js
Expand Up @@ -7848,6 +7848,34 @@ FolderStorage.prototype = {
},
_refreshSlice: function fs__refreshSlice(slice, checkOpenRecency,
releaseMutex) {

var doneCallback = function refreshDoneCallback(err, bisectInfo,
numMessages) {
slice._onAddingHeader = null;

var reportSyncStatusAs = 'synced';
switch (err) {
case 'aborted':
case 'unknown':
reportSyncStatusAs = 'syncfailed';
break;
}

releaseMutex();
slice.waitingOnData = false;
slice.setStatus(reportSyncStatusAs, true, false, false, null,
newEmailCount);
return undefined;
}.bind(this);

// If the slice is dead, its startTS and endTS will be set to
// null, so there is no range available to refresh. (See Bug 941991.)
if (slice.isDead) {
console.log('MailSlice: Attempted to refresh a dead slice.');
doneCallback('unknown');
return;
}

slice.waitingOnData = 'refresh';

var startTS = slice.startTS, endTS = slice.endTS,
Expand Down Expand Up @@ -7911,26 +7939,6 @@ FolderStorage.prototype = {
if (startTS)
startTS = quantizeDate(startTS);

var doneCallback = function refreshDoneCallback(err, bisectInfo,
numMessages) {
slice._onAddingHeader = null;

var reportSyncStatusAs = 'synced';
switch (err) {
case 'aborted':
case 'unknown':
reportSyncStatusAs = 'syncfailed';
break;
}

releaseMutex();
slice.waitingOnData = false;
slice.setStatus(reportSyncStatusAs, true, false, false, null,
newEmailCount);
return undefined;
}.bind(this);


// In the initial open case, we support a constant that allows us to
// fast-path out without bothering the server.
if (checkOpenRecency) {
Expand Down

0 comments on commit 2f60002

Please sign in to comment.