         {withCredentials}
       success: (data) ->
         if @options.patch then @previouslySavedContent = data
+        metadata.name ?= data.docName
         callback null, new CloudContent data.content or data
       error: ->
         message = if metadata.sharedContentId

      sendContent = diff
      url = patchDocumentUrl
    else
      if metadata.name then params.recordname = metadata.name
      url = saveDocumentUrl
      sendContent = content


      callback err, data.id

  save: (content, metadata, callback) ->
    content = @_wrapContent content.getContent(), metadata

    withCredentials = true
    isSharing = metadata.sharedContentSecretKey?
