urql-graphql / urql-devtools

A tool for monitoring and debugging urql during development
https://formidable.com/open-source/urql/docs/advanced/debugging/#devtools
MIT License
257 stars 11 forks source link

Add the ability to export/import an event graph for a certain timeframe #346

Open Kingdutch opened 3 years ago

Kingdutch commented 3 years ago

About

I'm currently trying to debug what appears to be a race condition and I'm unclear where the cause is.

It would be helpful if I could export the events that were registered by the devtools so that I could add this to a bug report/support request.

That would allow another developer to see the order of events and see what's happening and what's triggering the incorrect state.

andyrichardson commented 3 years ago

Hi @Kingdutch 👋

Right now that isn't something that we would be looking to add support for inside of devtools; but fear not - I have a solution for you!

You can listen to debug events on the client (and export them however you want).

I'll close this for now but let me know if I'm misunderstanding the request or if you just want some help trying to catch that race condition 👍

Kingdutch commented 3 years ago

It wasn't directly for race conditions only. It's like being able to export performance (flame) graphs in browser devtools.

It could be useful when discussing an issue to be able to view the same thing as what the reporting user is seeing. Trying to do this with screenshots and descriptions is difficult. The output from devtools makes a good timeline for what happens in Urql and the Urql cache when something goes wrong. Being able to export that allows a more knowledgeable user (e.g. an Urql maintainer or other dev) to import what happened and zoom in on the details that are important (without having to go back 'n forth to the reporting user).

andyrichardson commented 3 years ago

@Kingdutch thanks for clarifying!

So if I'm getting this right, you would want to:

In terms of whether we would do this or not, I'm totally sure of the value and I'd guess it would be a fair amount of effort. I'll leave it open anyhow to get thoughts from others!

In the meantime, I'd say there are a fair number of alternatives:

The conversation is still open so if you have a very clear idea of how this could be done and where this provides value, fight your case 👊