always show debug oauth2 request timeline button #4768
Merged
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.
if this doesn't get the award for "best one-liner" I don't know what will, haha
Context
When you do OAuth2 "stuff" (in general) there are separate out-of-band calls that happen sometimes, for example to a
/token
endpoint to fetch your token. Of course, when using OAuth2 Authentication in Insomnia, Insomnia handles this for you. Great!What's not great, though, is that you can't actually see that request. If you look at the timeline you see the timeline for the request corresponding to what's in your URL bar, which in this example is
/client-credentials
.The behavior before this PR
Today on the stream we were debugging #4715 but had a pretty hard time because prior to now, you could not see successful requests to the
/token
endpoint and the bug we were looking into related to this OAuth-specific request. Hilariously, the stream is a good example of exactly the kind of problems our users face when trying to debug such things on their own.However, we located something of an escape hatch. You see, when you have an error in a request, just recently we added the functionality to see the timeline for the error.
It looks like this:
What this PR changes
To solve this, we tried (and failed at a few things), but eventually noticed that if we simply render the button at all times, it will correctly show the
/token
request whenever it has been made (including if it's cached) and not otherwise.Notice the button on the
AFTER
that reads "Response Timeline"While from a code perspective this is a pretty minor (literal one line) change... this has pretty cool implications for users trying to investigate the OAuth calls that Insomnia makes.
The result of this is that when a user clicks this new (now, always present) button, they can see the full timeline whenever they wish:
changelog(Improvements): adds a "Response Timeline" so that now you can see a raw timeline output of all OAuth 2 token requests