-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(replay): Add additional safeguards for capturing network bodies #9506
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
Conversation
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we log here? or let it bubble up and log somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, I'll add a log for this case!
7de3c2b
to
ca842c1
Compare
a6ba600
to
6d0e4d4
Compare
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
Partial
to ensure we guard against any of the things not actually being defined, to be on the safe side.Hopefully fixes #9339