Problem
Drive-backed notebook creation can leave a metadata-only file and fail recovery with TypeError: Failed to fetch in the browser.
The ordinary Drive metadata request succeeds, including CORS preflight and the actual response. The recovery path then requests the same file and fields using a slightly different URL shape. Its preflight succeeds, but the actual request fails at the browser boundary.
Reproduction
- Start a Drive-backed notebook creation through WebMCP.
- Let the initial media upload fail after Drive has created the file.
- Retry the same idempotent creation request.
- Observe that file discovery and media download succeed, but the version check fails with
TypeError: Failed to fetch.
The failed metadata URL omits the redundant fileId query parameter used by the working normal metadata path. Initial media uploads also omit the version receipt fields used by the newer recovery upload path.
Expected behavior
The retry should adopt the existing metadata-only file, verify its current version, upload the intended bytes, and return the persisted Drive URI and revision.
Proposed fix
- Keep version checks on the request shape already used by the working metadata path.
- Request version receipt fields from initial media uploads too.
- Preserve shared-drive and resource-key behavior.
Problem
Drive-backed notebook creation can leave a metadata-only file and fail recovery with
TypeError: Failed to fetchin the browser.The ordinary Drive metadata request succeeds, including CORS preflight and the actual response. The recovery path then requests the same file and fields using a slightly different URL shape. Its preflight succeeds, but the actual request fails at the browser boundary.
Reproduction
TypeError: Failed to fetch.The failed metadata URL omits the redundant
fileIdquery parameter used by the working normal metadata path. Initial media uploads also omit the version receipt fields used by the newer recovery upload path.Expected behavior
The retry should adopt the existing metadata-only file, verify its current version, upload the intended bytes, and return the persisted Drive URI and revision.
Proposed fix