implement forgot password/passphrase dialogs
authorDan Mills <thunder@mozilla.com>
Sun, 20 Sep 2009 19:26:01 -0700
changeset 45764 829ed681db42d0c19f2d2129dc751674ca036735
parent 45763 bcd03a8e90155ab08263fc48fd3c6ee795310d3f
child 45765 5fe3e29d93c310b7204b944bd0f26f180bdc2afc
push id14033
push useredward.lee@engineering.uiuc.edu
push dateWed, 23 Jun 2010 22:21:35 +0000
treeherdermozilla-central@227db4ad8cdf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
implement forgot password/passphrase dialogs
services/sync/modules/service.js
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -150,17 +150,17 @@ StatusRecord.prototype = {
       this.service = this.sync = SYNC_FAILED_PARTIAL;
 
     this.engines[engineName] = statusCode;
   },
 
   resetEngineStatus: function() {
     this.engines = {};
   },
-  
+
   _resetBackoff: function () {
     this.enforceBackoff = false;
     this.backoffInterval = 0;
     this.minimumNextSync = 0;
   }
 };
 
 
@@ -594,16 +594,18 @@ WeaveSvc.prototype = {
   resetPassphrase: function WeaveSvc_resetPassphrase(newphrase)
     this._catch(this._notify("resetpph", "", function() {
       /* Make remote commands ready so we have a list of clients beforehand */
       this.prepCommand("logout", []);
       let clientsBackup = Clients._store.clients;
 
       /* Wipe */
       this.wipeServer();
+      PubKeys.clearCache();
+      PrivKeys.clearCache();
 
       /* Set remote commands before syncing */
       Clients._store.clients = clientsBackup;
       let username = this.username;
       let password = this.password;
       this.logout();
 
       /* Set this so UI is updated on next run */
@@ -640,17 +642,17 @@ WeaveSvc.prototype = {
     let listener = new Utils.EventListener(Utils.bind2(this,
       function WeaveSvc__autoConnectCallback(timer) {
         this._autoConnectTimer = null;
         this._autoConnect();
       }));
     this._autoConnectTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
 
     this._autoConnectAttempts++;
-    let interval = this._calculateBackoff(this._autoConnectAttempts, 
+    let interval = this._calculateBackoff(this._autoConnectAttempts,
                                           SCHEDULED_SYNC_INTERVAL);
     this._autoConnectTimer.initWithCallback(listener, interval,
                                             Ci.nsITimer.TYPE_ONE_SHOT);
     this._log.debug("Scheduling next autoconnect attempt in " +
                     interval / 1000 + " seconds.");
   },
 
   persistLogin: function persistLogin() {
@@ -1197,18 +1199,18 @@ WeaveSvc.prototype = {
       return;
 
     this._log.debug("Setting meta payload storage version to " + WEAVE_VERSION);
     meta.payload.storageVersion = WEAVE_VERSION;
     let resp = new Resource(meta.uri).put(meta);
     if (!resp.success)
       throw resp;
   },
-  
-  
+
+
   /**
    * Check to see if this is a failure
    *
    */
   _checkServerError: function WeaveSvc__checkServerError(resp) {
     if (Utils.checkStatus(resp.status, null, [500, [502, 504]])) {
       this.status.enforceBackoff = true;
       if (resp.status == 503 && resp.headers["Retry-After"])