We are developing a private application using delegated Microsoft Graph access to personal OneDrive. An existing .xlsx file is approximately 93 KB. It must remain the same driveItem and must only be replaced if the original file revision still matches at the instant of publication.
Observed sequence:
- GET existing item's identity, parent, name and eTag E1.
- POST /me/drive/items/{file-id}/createUploadSession with If-Match: E1 and body {"item":{"@microsoft.graph.conflictBehavior":"replace"},"deferCommit":true}.
- PUT bytes to the returned upload URL; HTTP 202 received. The file remains at E1.
- Attempt metadata PUT with Content-Type: application/json, If-Match: E1 and body {"name":"disposable.xlsx","@microsoft.graph.conflictBehavior":"replace","@microsoft.graph.sourceUrl":"{upload-session-url}"}.
Variants tried:
- Parent-plus-filename addressing: HTTP 400 invalidRequest on allocation commit.
- Parent item addressing: HTTP 412 for both deliberately invalid and current workbook eTags.
- Existing workbook item addressing: HTTP 400 invalidRequest on the first stale-revision diagnostic; no valid control ran.
No successful publication was observed. The disposable file remains at its original revision and hash. Upload-session cleanup is attempted; we retain unresolved operation records and do not automatically retry or fall back to unconditional upload.
Please clarify:
- What exact supported endpoint, method, headers and body atomically replace the contents of the same existing OneDrive Personal item only if its frozen file eTag still matches at publication?
- For deferred sessions, does final metadata PUT compare the destination file's revision or the addressed parent resource's revision? Which addressing form is supported for replacing an existing immutable item?
- Is PUT /me/drive/items/{file-id}/content with If-Match explicitly supported as an atomic final-write condition? The current simple-upload request-header table omits If-Match.
- How are concurrent native Excel edits, rename/move, and delete/recreate handled? Which checks are atomic versus application preflight only?
- Which returned codes guarantee that no content was published? After a timeout/lost response or rejected commit, how can we prove the staged session cannot publish later before releasing our application writer lock?
- Please identify the authoritative documentation for OneDrive Personal and distinguish it from OneDrive for Business/SharePoint behaviour.
We can provide sanitised timestamps, request IDs and request/response diagnostics through a suitable private support channel. This question intentionally excludes credentials, signed URLs, real item identifiers, workbook contents and account information.
References: