The auto-login at startup no longer unconditionally syncs; if the login fails, the sync is now aborted.
The auto-login at startup no longer unconditionally syncs; if the login fails, the sync is now aborted.
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -205,25 +205,33 @@ WeaveSvc.prototype = {
if (!this.enabled)
return 0; // manual/off
return Utils.prefs.getIntPref("schedule");
},
onWindowOpened: function Weave__onWindowOpened() {
if (!this._startupFinished) {
if (Utils.prefs.getBoolPref("autoconnect") &&
- this.username && this.username != 'nobody') {
- // Login, then sync.
- let self = this;
- this.login(function() { self.sync(); });
- }
+ this.username && this.username != 'nobody')
+ this._initialLoginAndSync.async(this);
this._startupFinished = true;
}
},
+ _initialLoginAndSync: function Weave__initialLoginAndSync() {
+ let self = yield;
+
+ // Any exceptions thrown by the login process will be propagated
+ // out here, so there's no need to check to see if the login was
+ // successful; if it wasn't, this coroutine will just abort.
+
+ yield this.login(self.cb);
+ yield this.sync(self.cb);
+ },
+
_setSchedule: function Weave__setSchedule(schedule) {
switch (this.schedule) {
case 0:
this._disableSchedule();
break;
case 1:
this._enableSchedule();
break;