{"action":"opened","issue":{"url":"https://api.github.com/repos/OneDrive/onedrive-api-docs/issues/225","labels_url":"https://api.github.com/repos/OneDrive/onedrive-api-docs/issues/225/labels{/name}","comments_url":"https://api.github.com/repos/OneDrive/onedrive-api-docs/issues/225/comments","events_url":"https://api.github.com/repos/OneDrive/onedrive-api-docs/issues/225/events","html_url":"https://github.com/OneDrive/onedrive-api-docs/issues/225","id":111676143,"number":225,"title":"Attempting to update an item in an AppFolder using \"@name.conflictBehavior=replace\" results in a 409 / nameAlreadyExists error.","user":{"login":"emdelaney","id":8574254,"avatar_url":"https://avatars.githubusercontent.com/u/8574254?v=3","gravatar_id":"","url":"https://api.github.com/users/emdelaney","html_url":"https://github.com/emdelaney","followers_url":"https://api.github.com/users/emdelaney/followers","following_url":"https://api.github.com/users/emdelaney/following{/other_user}","gists_url":"https://api.github.com/users/emdelaney/gists{/gist_id}","starred_url":"https://api.github.com/users/emdelaney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emdelaney/subscriptions","organizations_url":"https://api.github.com/users/emdelaney/orgs","repos_url":"https://api.github.com/users/emdelaney/repos","events_url":"https://api.github.com/users/emdelaney/events{/privacy}","received_events_url":"https://api.github.com/users/emdelaney/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-15T18:16:22Z","updated_at":"2015-10-15T18:16:22Z","closed_at":null,"body":"I have an app folder that contains items which are frequently replaced with updated items of the same name. Recently, when attempting to update an existing file with @name.conflictBehavior=replace, OneDrive has started to return a 409 error instead of replacing the file as expected. \r\n\r\n**The \"fail\" and \"rename\" conflict behaviors work as expected:**\r\nCase 1: `PUT https://api.onedrive.com/v1.0/drive/special/approot:/test.txt:/content?access_token={access-token-here}&%40name.conflictBehavior=fail`\r\nWhen the file test.txt does not exist, doing two PUT requests with a conflict behavior of \"fail\" works as expected: the file is created successfully on the first request, returning a 201 status code; the second request fails, returning a 409 HTTP error code and a JSON error code of nameAlreadyExists.\r\n\r\nCase 2: `PUT https://api.onedrive.com/v1.0/drive/special/approot:/test.txt:/content?access_token={access-token-here}&%40name.conflictBehavior=rename`\r\nWhen the file test.txt does not exist, doing two PUT requests with a conflict behavior of \"rename\" works as expected: the file is created successfully on the first request, returning a 201 status code; the second request also succeeds, creating a new item, \"test 1.txt\".  \r\n\r\n**The \"replace\" conflict behavior has the same behavior as the \"fail\" case:**\r\nCase 3 (broken): `PUT https://api.onedrive.com/v1.0/drive/special/approot:/test.txt:/content?access_token={access-token-here}&%40name.conflictBehavior=replace`\r\nWhen the file test.txt does not exist, **doing two PUT requests with a conflict behavior of \"replace\" has the same results as Case 1 / \"fail\":** the file is created successfully on the first request, returning a 201 status code; the second request fails, returning a 409 HTTP error code and a JSON error code of nameAlreadyExists. The second request should probably succeed, replacing the existing item, instead of failing with a nameAlreadyExists error.\r\n\r\n**Steps to reproduce:** Execute the case 3 PUT request twice with a valid access token and request body.\r\n"}}