-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(replay): Capture JSON XHR response bodies #9623
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 📦
|
|
||
__DEBUG_BUILD__ && logger.info('[Replay] Skipping network body because of body type', body); | ||
|
||
return [undefined]; |
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.
We should have a NetworkMetaWarning for this case as well
body: XMLHttpRequest['response'], | ||
responseType: XMLHttpRequest['responseType'], | ||
): [string | undefined, NetworkMetaWarning?] { | ||
logger.log(body, responseType, typeof body); |
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 this be here?
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.
no, oops!
9476ae3
to
87fe76a
Compare
OK, so I updated this to:
|
4810a9b
to
82f8154
Compare
This is stupid, now that I figured it out. Basically, if you set
xhr.responseType = 'json'
, it will forcexhr.response
to be a POJO - which we can't parse right now.We now handle this case specifically.
This also adds a new
UNPARSEABLE_BODY_TYPE
meta warning if we are not getting a body because it is not matching any of the known/parsed types.Closes #9339