                             cb(err)
                         else
                             dbg("got it -- length=#{data?.length}")
-                            @set(data)
+                            @_doc.from_str(data)
                             # we also know that this is the version on disk, so we update the hash
                             @_set_save(state:'done', error:false, hash:misc.hash_string(data))
                             cb()

# if nothing explicitly passed in for doc in SyncString constructor.
class StringDocument
    constructor: (@_value='') ->
    set: (value) ->
        @_value = value
    get: ->
        @_value


class exports.SyncString extends SyncDoc

        else
            # insert about 25 characters at random
            s = s.slice(0,i) + Math.random().toString(36).slice(2) + s.slice(i)
        @_doc.from_str(s)

    test_random_edits: (opts) =>
        opts = defaults opts,
