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

HttpRequest.newBuilder() does not preserve executionContext #6349

Closed
varahash opened this issue Jan 10, 2025 · 4 comments · Fixed by #6350
Closed

HttpRequest.newBuilder() does not preserve executionContext #6349

varahash opened this issue Jan 10, 2025 · 4 comments · Fixed by #6350
Milestone

Comments

@varahash
Copy link
Contributor

Version

4.1.0

Summary

The HttpRequest.newBuilder() is a convenient function for creating copy of HttpRequest to modify it, as an user I expect that it copies all data from original request. But unfortunately it does so for all fields except executionContext field.
The problem with this is when you have a chain of HttpInterceptor's and each depends on executionContext you must make sure that all interceptors in the chain also uses HttpRequest.Builder.addExecutionContext() to avoid bugs with missing executionContext.

Please consider copying executionContext field in HttpRequest.newBuilder() by default, as it done with other fields.

Steps to reproduce the behavior

No response

Logs

No response

@martinbonnin
Copy link
Contributor

This was most likely an oversight as executionContext was added after the fact. Thanks for noticing it 🙏

Do you want to open a pull request to add this?

@varahash
Copy link
Contributor Author

Yes, I will create PR

@martinbonnin
Copy link
Contributor

Thanks! Let me know if you need anything. This should happen around here

Copy link
Contributor

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Kotlin usage and allow us to serve you better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants