fix(replay): Add additional safeguards for capturing network bodies#9506
Merged
fix(replay): Add additional safeguards for capturing network bodies#9506
Conversation
Contributor
size-limit report 📦
|
billyvg
approved these changes
Nov 9, 2023
Member
billyvg
left a comment
There was a problem hiding this comment.
Instead of swallowing up errors, we may want to log them so that we're able to debug them
| if (body instanceof FormData) { | ||
| return _serializeFormData(body); | ||
| } | ||
| } catch {} // eslint-disable-line no-empty |
Member
There was a problem hiding this comment.
Should we log here? or let it bubble up and log somewhere?
Member
Author
There was a problem hiding this comment.
sure, I'll add a log for this case!
7de3c2b to
ca842c1
Compare
a6ba600 to
6d0e4d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds additional safeguards around fetch/xhr body capturing for replay.
I added additional try-catch in all places that depend on
networkCaptureBodies.This also types the fetch/xhr hints as
Partialto ensure we guard against any of the things not actually being defined, to be on the safe side.Hopefully fixes #9339