-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add the ability to replay requests from the details view #197
Conversation
…query is invalidated
commit:
|
studio/src/pages/RequestDetailsPage/RequestDetailsPageV2/RequestDetailsPageV2Content.tsx
Outdated
Show resolved
Hide resolved
enabled: boolean; | ||
}>, | ||
) => { | ||
const excludedHeaders = [ |
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.
nit: could use Set
"user-agent", | ||
"referer", | ||
"origin", | ||
"cookie", |
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 we wanna filter out cookie?
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.
if someone attached a cookie for example, this breaks auth.
|
||
const replayBody = useMemo(() => { | ||
const body = getRequestBody(span); | ||
try { |
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 need to refactor, but for future reference, i made a utility for this kind of logic
utility is called isJson
, should be importable from the utils module
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.
some flakiness on getting the "view latest" cta to appear for me, but might be specific to running things locally + a stale websocket
only thing that'd be worth considering imo is how to deal with horizontal space on smaller-ish screens, like half of a laptop screen
shorter copy, smaller font, something of the like
Addresses FP-3855. This PR adds the ability to replay requests from the request details view.
To achieve this, we're adding 3 hooks:
useShouldReplay
which should gate replayability only to json/text requestsuseReplayRequest
which enables replaying the requestuseMostRecentRequest
which informs the UI if the currently viewed request is the most recent oneTODO:
useReplayRequest
Of note: we've taken some shortcuts with regards to showing intermediate states while the request is loading or having some more robust interaction patterns in general. This is because there's explorative work in play that if validated will remove the request detail view in general in which case we shouldn't spend too much time on this.