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

Transform function can change response for downstream links #442

Closed
bentburton opened this issue Nov 18, 2022 · 2 comments · Fixed by #443
Closed

Transform function can change response for downstream links #442

bentburton opened this issue Nov 18, 2022 · 2 comments · Fixed by #443
Labels
documentation Improvements or additions to documentation

Comments

@bentburton
Copy link

bentburton commented Nov 18, 2022

I am trying to include the result that the backend is sending with the include fetch results flag. If I modify the breadcrumb information It modifies it for the code calling the request instead of only modifying what is sent to sentry.

Here is an example:

Screen Shot 2022-11-18 at 2 32 20 PM

@bentburton
Copy link
Author

When doing this the code calling the login mutation is getting the token back as REDACTED. The act of filtering the breadcrumb is affecting the actual response

@spawnia
Copy link
Collaborator

spawnia commented Nov 18, 2022

Indeed, JavaScript objects are mutable. The object spread you are doing with const filteredBreadcrumb = { ...breadcrumb }; is only doing a shallow copy.

I recognize this is a potential footgun, so I am updating the docs to warn about it.

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

Successfully merging a pull request may close this issue.

2 participants