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

feat(replay): Add troubleshooting doc for Apollo Client response capture #7210

Merged
merged 3 commits into from
Jun 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/platforms/javascript/common/session-replay/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,23 @@ To hide this content, block the iframe, as described in our Session Replay <Plat
## Replay on My Browser Extension Doesn't Work

This is not a supported use-case. The replay package is built to work on a website and not as an externally-loaded script via browser extension or other mechanism. In fact, Sentry's Session Replay product can help developers find out when a third-party Chrome extension causes otherwise hard to debug or reproduce issues with their website.

## Response data for Apollo GraphQL Client network requests is not captured

Apollo Client sends an abort signal via `AbortController` whenever a query completes, to clean up and cancel all in-flight queries.
When this happens, the Replay can't capture the response body because the request is handled as aborted before Replay can access the response.

To avoid this, disable this behavior of Apollo Client by configuring your own abort signal:

```js
const abortController = new AbortController();

const httpLink = createHttpLink({
// ... other options
fetchOptions: {
signal: abortController.signal, // overwrite the default abort signal
},
});
```

With this configuration, Replay is able to capture response bodies from Apollo Client requests.