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 · 6 comments · Fixed by #11860, #11855, MTES-MCT/rapportnav2#239, hantsy/spring-graphql-sample#2696 or MTES-MCT/rapportnav2#253
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 🚀

Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
For general questions, we recommend using StackOverflow or our discord server.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.