warrenday / graphql-network-inspector

A better network inspector for viewing and debugging GraphQL requests.
MIT License
466 stars 46 forks source link

Doesn't show "pending" connections #80

Closed sepsol closed 1 year ago

sepsol commented 1 year ago

Describe the bug In chrome devtools I'm able to identify network requests that are stuck in pending but in this extension (as good as it is) I'm not able to see that pending request until after it is resolved and returns 200 OK to my browser.

To Reproduce Create a demanding query resolver and make a request to it from the frontend while having your devtools open. Compare the results from the built-in Network tab vs GraphQL Network tab.

Expected behavior To see a behavior like the native Network tab, i.e. the pending requests show up as pending.

Screenshots Built-in Network GraphQL Network
2023-02-01_12-02-53 2023-02-01_12-03-17

Desktop (please complete the following information):

warrenday commented 1 year ago

I've spent quite a bit of time trying to make this work, but unfortunately I am yet to find a good solution.

The chrome network API only provides an event for when the request finishes. Which is what we use to display the request. https://developer.chrome.com/docs/extensions/reference/devtools_network/#event-onRequestFinished

Chrome also supplies a webRequest API which is more for intercepting request headers. But it does allow us to see a request starting. Unfortunately there is no reliable way to associate the webRequest event with a network event. https://developer.chrome.com/docs/extensions/reference/webRequest/

So as far as I am aware (and I could be wrong) there is no way with a third party extension to display both a request starting and finishing.

sepsol commented 1 year ago

Well, that's really unfortunate :( But I appreciate you taking the matter seriously and dedicating time to look into it!

warrenday commented 1 year ago

Closing as currently not possible