Skip to content
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

Show in progress queries/mutations #117

Open
sobrinho opened this issue Nov 2, 2023 · 8 comments
Open

Show in progress queries/mutations #117

sobrinho opened this issue Nov 2, 2023 · 8 comments

Comments

@sobrinho
Copy link

sobrinho commented Nov 2, 2023

Is your feature request related to a problem? Please describe.
Some queries/mutations can take a lot of time, i.e.: 30 seconds.

Describe the solution you'd like
During that time, the request is going on, would be nice to see it as "In progress" or "Waiting for response" in the inspector.

Describe alternatives you've considered
Usually I keep an eye on network tab for those requests but then I need to be aware they are taking too long and move between tabs.

Additional context
N/A

@warrenday
Copy link
Owner

Unfortunately this isn't possible. Chrome exposes no api to listen to the start of a request that we are able to associate to the end of a request.

@sobrinho
Copy link
Author

sobrinho commented Nov 6, 2023

I'm not familiar with the SDK for extensions but can't we simple render the loading, make the request and when it finishes render what needs to be rendered?

@warrenday
Copy link
Owner

warrenday commented Nov 6, 2023

We only receive an event from the chrome api once the request has finished.

There is a way to get events when a request starts, which contains less information, but there is no way to associate the start event with the end event.

These events are:

Request Started:
A few events that do expose a request starting
https://developer.chrome.com/docs/extensions/reference/webRequest/

Request Finished:
An onRequestFinished event which contains all network information
https://developer.chrome.com/docs/extensions/reference/devtools_network/#event-onRequestFinished

If there were some fixed id between the start and end events we could link the two. But as far as I can tell there is nothing concrete.

@sobrinho
Copy link
Author

sobrinho commented Nov 6, 2023

Can't we curry the callback function with the identifier somehow?

Again, I never worked on a Chrome Extension before, going through the docs here to see how it works but it might take me a while to figure.

@sobrinho
Copy link
Author

sobrinho commented Nov 6, 2023

Or even use a WeakMap with the request object (in the case it's the same object on both callbacks), I don't know yet.

@sobrinho
Copy link
Author

sobrinho commented Nov 6, 2023

Did you see that?

Request IDs
Each request is identified by a request ID. This ID is unique within a browser session and the context of an extension. It remains constant during the life cycle of a request and can be used to match events for the same request. Note that several HTTP requests are mapped to one web request in case of HTTP redirection or HTTP authentication.

https://developer.chrome.com/docs/extensions/reference/webRequest/#request-ids

@warrenday
Copy link
Owner

I think that's just in the context of all the events on the webRequest api. Whereas we are mixing webRequest and network.

@warrenday
Copy link
Owner

This is being worked on currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants