mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 534218 - Changing sync direction from outdated clients loses client/server data [r=mconnor]
Check remoteSetup first to determine if we're okay to sync before wiping client/remote. Additionally only wipe enabled engines instead of everything.
This commit is contained in:
parent
a0b39324a1
commit
74ee9ca0f3
@ -1146,17 +1146,6 @@ WeaveSvc.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Svc.Prefs.isSet("firstSync")) {
|
||||
switch(Svc.Prefs.get("firstSync")) {
|
||||
case "wipeClient":
|
||||
this.wipeClient();
|
||||
break;
|
||||
case "wipeRemote":
|
||||
this.wipeRemote(Engines.getAll().map(function(e) e.name));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Clear out any potentially pending syncs now that we're syncing
|
||||
this._clearSyncTriggers();
|
||||
this.nextSync = 0;
|
||||
@ -1170,6 +1159,16 @@ WeaveSvc.prototype = {
|
||||
if (!(this._remoteSetup()))
|
||||
throw "aborting sync, remote setup failed";
|
||||
|
||||
// Wipe data in the desired direction if necessary
|
||||
switch (Svc.Prefs.get("firstSync")) {
|
||||
case "wipeClient":
|
||||
this.wipeClient(Engines.getEnabled().map(function(e) e.name));
|
||||
break;
|
||||
case "wipeRemote":
|
||||
this.wipeRemote(Engines.getEnabled().map(function(e) e.name));
|
||||
break;
|
||||
}
|
||||
|
||||
// Ping the server with a special info request once a day
|
||||
let infoURL = this.infoURL;
|
||||
let now = Math.floor(Date.now() / 1000);
|
||||
|
Loading…
Reference in New Issue
Block a user