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

BatchHTTPLink is not monitoring friendly #11849

Closed
dbasilio opened this issue May 16, 2024 · 5 comments · Fixed by #11860 · May be fixed by #11855
Closed

BatchHTTPLink is not monitoring friendly #11849

dbasilio opened this issue May 16, 2024 · 5 comments · Fixed by #11860 · May be fixed by #11855
Assignees
Labels

Comments

@dbasilio
Copy link

Issue Description

We're trying to integrate Datadog RUM, which attaches headers to outgoing requests if they match certain patterns. When using HTTPLink, the headers are always correctly attached. When using BatchHTTPLink, the headers are not attached. This was previously not working for HTTPLink but was fixed in #8603, but that same fix was not applied to BatchHTTPLink.

BatchHTTPLink is maintaining a local reference to fetch that monitoring tools cannot inject headers into.

Link to Reproduction

https://github.com/dbasilio/apollo-dd-rum-repro

Reproduction Steps

See the readme in the repro repo

@apollo/client version

3.8.10

@alessbell
Copy link
Member

Hi @dbasilio 👋 Thanks for opening this issue - the reproduction and linked issues are helpful :) I'll get this on our team agenda, thanks!

@alessbell
Copy link
Member

Quick update, I have a PR open here: #11860

alessbell added a commit that referenced this issue May 20, 2024
* fix: reevaluate window.fetch each time BatchHttpLink is used, if not configured using options.fetch

* chore: add changeset
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 Client usage and allow us to serve you better.

@alessbell
Copy link
Member

The fix be included in the next patch release, v3.10.5, which will go out later this week 🚀

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