         @_sync_lock = true
         before = @diffsync_server.live
         @diffsync_server.push_edits (err) =>
-            @_sync_lock = false
             after = @diffsync_server.live
+            @set_content(after)
             if err
+                # We do *NOT* remove the sync_lock in this branch; only do that after a successful sync, since
+                # otherwise clients think they have successfully sync'd with the hub, but when the hub resets,
+                # the clients end up doing the wrong thing. 
                 winston.debug("codemirror session local hub sync error -- #{err}")
                 if typeof(err) == 'string'
                     err = err.toLowerCase()


        @connect      = misc.retry_until_success_wrapper(f:@_connect, logname:'connect')
        # min_interval: to avoid possibly DOS's a local hub -- not sure what best choice is here.
        @sync = misc.retry_until_success_wrapper(f:@_sync, min_interval:200, logname:'localhub_sync')

        # The downstream (web browser) clients of this hub
        @diffsync_clients = {}

        @_sync_lock = true
        before = @diffsync_server.live
        ds_client.recv_edits    mesg.edit_stack, mesg.last_version_ack, (err) =>
            if err
                @_sync_lock = false
                client.error_to_client(id:mesg.id, error:"CodeMirrorSession -- unable to push diffsync changes from client (id=#{client.id}) -- #{err}")
                return

            # Update master live document with result.
            @set_content(ds_client.live)
            @_sync_lock = false

            # Send back our own edits to this client.
            ds_client.remote.current_mesg_id = mesg.id  # used to tag the return message
