Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove current_request_steps in Req.Request #255

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thenrio
Copy link

@thenrio thenrio commented Oct 6, 2023

Just use request_steps.

@wojtekmach
Copy link
Owner

Thank you for the PR. It seems we are missing tests because the build should have failed as we needed this design for things like not replying base_url+url on retries, etc. I’ll investigate. Maybe it is not needed after all!

@thenrio
Copy link
Author

thenrio commented Oct 6, 2023

Sure! Cheers.

@wojtekmach
Copy link
Owner

Note to self: revisit Req.Request.prepare/1 while at it.

@thenrio thenrio force-pushed the remove-current_request_steps branch from b0b1a5d to b51f580 Compare March 27, 2024 10:31
@thenrio
Copy link
Author

thenrio commented Mar 27, 2024

Hi @wojtekmach, I noticed that Req.Request.run_request/1 "consumes" the current_request_steps:

run_request(%{request | current_request_steps: rest})
.

Then we don't run base_url or params twice on retry, such as in

test "does not re-encode params", c do
.
In fact, retry does not run any of the input request_steps, as current_request_steps is empty...

This commit "consumes" the request_steps, so we don't run base_url or params twice on retry.
We achieve same behavior with a list removed from memory and a lookup removed,

step = Keyword.fetch!(request.request_steps, step)
.

Cheers.

@wojtekmach wojtekmach force-pushed the main branch 4 times, most recently from 249b80c to 16991cd Compare May 28, 2024 10:40
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.

2 participants