                     # one client (and upstream) at a time.
                     cb(err)
                 else  # all other errors should reconnect first.
-                    winston.debug("sync: reconnecting...")
-                    @reconnect () =>
-                        cb(err)
+                    winston.debug("sync: trying once to reconnect...")
+                    @_connect (err) =>
+                        if err
+                            winston.debug("sync: restarting local hub...")
+                            @local_hub.restart (err) =>
+                                cb(true)
+                        else
+                            cb(true)  # successful connect, but we still need to return error so sync happens
             else
                 winston.debug("codemirror session local hub sync -- pushed edits, thus completing cycle")
                 if before != @diffsync_server.live

                    if not err
                        cb(err, socket)
                    else
                        if retries == 0
                            cb(err)
                        else
                            delete @_status  # forget port and secret token.
                            @new_socket(cb, retries - 1)

    remove_multi_response_listener: (id) =>
        delete @_multi_response[id]

            else if socket?
                @_sockets[opts.session_uuid] = socket
                socket.history = undefined
                opts.cb(false, socket)
        )

    # Connect the client with a console session, possibly creating a session in the process.
