                 let readyDeferred = SyncStateMachine.toReady(authState, prefs: syncPrefs)
                 let delegate = profile.getSyncDelegate()
 
-                return readyDeferred >>== { ready in
+                let go = readyDeferred >>== { ready in
                     function(delegate, syncPrefs, ready)
                 }
+
+                // Always unlock when we're done.
+                go.upon({ res in self.endSyncing() })
+
+                return go
             }
 
             log.warning("No account; can't sync.")


        private var syncTimer: NSTimer? = nil

        init(profile: BrowserProfile) {
            self.profile = profile
        }

        }
    }
}

class AlreadySyncingError: ErrorType {
    var description: String {
        return "Already syncing."
    }
}
