Skip to content

Treat 204 and 202 from a delete as success - #91

Merged
ilyabrin merged 1 commit into
mainfrom
fix/delete-status
Oct 7, 2026
Merged

ilyabrin merged 1 commit into
mainfrom
fix/delete-status

Conversation

@ilyabrin

@ilyabrin ilyabrin commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Why

DeleteResource accepted only 200, while the API answers 204 when the
resource is gone and 202 when a large folder is deleted in the
background. Every successful delete returned an error, after the file
had already been deleted. Batch deletes use the same method.

What

  • DeleteResource accepts 200, 202 and 204.
  • Tests for each, and for a 404 that must still fail. On the old code
    the 204 and 202 cases fail with "request failed with status 204".

Checked locally

go vet, go test ./... (also as 386), golangci-lint v2.13.2.

The API answers 204 once a resource is deleted, and 202 when a large
folder is deleted in the background, but DeleteResource accepted only
200. Every successful delete came back as "request failed with status
204", in yad as an error message after the file was already gone.
Batch deletes go through the same method and are fixed too.
@ilyabrin
ilyabrin merged commit bd1064d into main Oct 7, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant