Skip to content

Add request retry preparation#108

Merged
ioquatix merged 7 commits into
mainfrom
request-retry-method
Jul 24, 2026
Merged

Add request retry preparation#108
ioquatix merged 7 commits into
mainfrom
request-retry-method

Conversation

@ioquatix

@ioquatix ioquatix commented Jul 19, 2026

Copy link
Copy Markdown
Member

Summary

  • Add Protocol::HTTP::Request#rewind! to prepare a request body to be sent again, independent of request method semantics.
  • Add Protocol::HTTP::Request#retry! to prepare requests for safe ambiguous retries by checking method semantics and delegating to rewind!.
  • Preserve the existing Request#idempotent? behavior for compatibility with existing clients.
  • Cover rewind/retry preparation for no body, rewindable bodies, non-rewindable bodies, and non-idempotent methods.

Intended Usage

  • Use request.rewind! when the transport knows the previous attempt was not processed, e.g. Protocol::HTTP::RefusedError.
  • Use request.retry! when retrying an ambiguous failure, where method semantics matter.

Testing

  • bundle exec sus test/protocol/http/request.rb
  • bundle exec sus

@ioquatix
ioquatix merged commit e9e3f41 into main Jul 24, 2026
40 of 64 checks passed
@ioquatix
ioquatix deleted the request-retry-method branch July 24, 2026 21:11
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