Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bug 827333 - Don't show the empty folder message when we're waiting to get the real ActiveSync inbox #7409

Merged
merged 1 commit into from

2 participants

@jimporter
Collaborator

r? @asutherland. This is pretty simple, and just handles "syncblocked" like "synchronizing".

https://bugzilla.mozilla.org/show_bug.cgi?id=827333

@asutherland
Collaborator

r=asuth, works great on device

@jimporter jimporter Bug 827333 - [email/activesync] Hide the "no mail in thie folder" ale…
…rt when we're waiting to get the real inbox; r=asuth, a=blocking-basecamp
d412ac3
@jimporter jimporter merged commit 810f39d into mozilla-b2g:master
@jimporter jimporter deleted the unknown repository branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 10, 2013
  1. @jimporter

    Bug 827333 - [email/activesync] Hide the "no mail in thie folder" ale…

    jimporter authored
    …rt when we're waiting to get the real inbox; r=asuth, a=blocking-basecamp
This page is out of date. Refresh to see the latest.
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() {
Something went wrong with that request. Please try again.