Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #7409 from mozsquib/email-as-fake-inbox-loading

Bug 827333 - Don't show the empty folder message when we're waiting to get the real ActiveSync inbox
  • Loading branch information...
commit 810f39dea5122bd9a5b4fe97ace1aa805a7a1b65 2 parents 626e1a9 + d412ac3
@jimporter jimporter authored
Showing with 41 additions and 24 deletions.
  1. +19 −6 apps/email/js/ext/gaia-email-opt.js
  2. +22 −18 apps/email/js/message-cards.js
View
25 apps/email/js/ext/gaia-email-opt.js
@@ -25600,12 +25600,18 @@ FolderStorage.prototype = {
var progressCallback = slice.setSyncProgress.bind(slice);
- // If we're offline or the folder can't be synchronized right now, then
- // there's nothing to look into; use the DB.
- if (!this._account.universe.online ||
- !this.folderSyncer.syncable) {
+ // If we're offline, then there's nothing to look into; use the DB.
+ if (!this._account.universe.online) {
existingDataGood = true;
}
+ // If the folder can't be synchronized right now, just report the sync as
+ // blocked. We'll update it soon enough.
+ else if (!this.folderSyncer.syncable) {
+ console.log('Synchronization is currently blocked; waiting...');
+ slice.setStatus('syncblocked', false, true, false, 0.0);
+ releaseMutex();
+ return;
+ }
else if (this._accuracyRanges.length && !forceDeepening) {
ainfo = this._accuracyRanges[0];
var newestMessage = this.getYoungestMessageTimestamp();
@@ -34312,8 +34318,15 @@ ActiveSyncJobDriver.prototype = {
doneCallback(err ? 'aborted-retry' : null, null, !err);
if (inboxStorage && inboxStorage.hasActiveSlices) {
- console.log("Refreshing fake inbox");
- inboxStorage.resetAndRefreshActiveSlices();
+ if (!err) {
+ console.log("Refreshing fake inbox");
+ inboxStorage.resetAndRefreshActiveSlices();
+ }
+ // XXX: If we do have an error here, we should probably report
+ // syncfailed on the slices to let the user retry. However, what needs
+ // retrying is syncFolderList, not syncing the messages in a folder.
+ // Since that's complicated to handle, and syncFolderList will retry
+ // automatically, we can ignore that case for now.
}
});
},
View
40 apps/email/js/message-cards.js
@@ -398,26 +398,30 @@ MessageListCard.prototype = {
},
onStatusChange: function(newStatus) {
- if (newStatus === 'synchronizing') {
- this.syncingNode.classList.remove('collapsed');
- this.syncMoreNode.classList.add('collapsed');
- this.hideEmptyLayout();
+ switch (newStatus) {
+ case 'synchronizing':
+ case 'syncblocked':
+ this.syncingNode.classList.remove('collapsed');
+ this.syncMoreNode.classList.add('collapsed');
+ this.hideEmptyLayout();
+
+ this.progressNode.value = this.messagesSlice ?
+ this.messagesSlice.syncProgress : 0;
+ this.progressNode.classList.remove('hidden');
+ break;
+ case 'syncfailed':
+ // If there was a problem talking to the server, notify the user and
+ // provide a means to attempt to talk to the server again. We have made
+ // onRefresh pretty clever, so it can do all the legwork on
+ // accomplishing this goal.
+ Toaster.logRetryable(newStatus, this.onRefresh.bind(this));
- this.progressNode.value = this.messagesSlice ?
- this.messagesSlice.syncProgress : 0;
- this.progressNode.classList.remove('hidden');
- }
- // (cover both 'synced' and 'syncfailed')
- else {
- this.syncingNode.classList.add('collapsed');
- this.progressNode.classList.add('hidden');
+ // Fall through...
+ case 'synced':
+ this.syncingNode.classList.add('collapsed');
+ this.progressNode.classList.add('hidden');
+ break;
}
-
- // If there was a problem talking to the server, notify the user and provide
- // a means to attempt to talk to the server again. We have made onRefresh
- // pretty clever, so it can do all the legwork on accomplishing this goal.
- if (newStatus === 'syncfailed')
- Toaster.logRetryable(newStatus, this.onRefresh.bind(this));
},
showEmptyLayout: function() {
Please sign in to comment.
Something went wrong with that request. Please try again.