                 else
                     @session_uuid = resp.session_uuid
                     @chat         = resp.chat
+
                     codemirror_sessions.by_uuid[@session_uuid] = @
+
+                    if @_last_sync?
+                        # We have sync'd before.
+                        patch = @diffsync_server._compute_edits(@_last_sync, @diffsync_server.live)
 
                     # Reconnect to the upstream (local_hub) server
                     @diffsync_server = new diffsync.DiffSync(doc:resp.content)
+
+                    if @_last_sync?
+                        # applying missed patches to the new upstream version that we just got from the hub.
+                        @_apply_patch_to_live(patch)
+                    else
+                        # This initialiation is the first.
+                        @_last_sync   = resp.content
+
                     @diffsync_server.connect(new CodeMirrorDiffSyncLocalHub(@))
 
                     #

        # The downstream clients of this hub
        @diffsync_clients = {}

        @connect (err) =>
            if err
                opts.cb(err)

                    #
                    @set_content(resp.content)

                    cb()

    _apply_patch_to_live: (patch) =>
        @diffsync_server._apply_edits_to_live(patch)
        for id, ds of @diffsync_clients
            ds.live = @diffsync_server.live

    set_content: (content) =>
        @diffsync_server.live = content
