Starcounter / DevTools

A browser extension that helps you debug Starcounter apps with ease
3 stars 1 forks source link

Add WebSocket state change to the Network tab #23

Closed miyconst closed 9 years ago

miyconst commented 9 years ago

WebSoket upgrades, open/close connection should also be visible on the Network tab.

ghost commented 9 years ago

Thanks for the question. What kind of statistics would you like to have there? Summary, or individual for each?

miyconst commented 9 years ago

@alemoi this is not a question, this is a task for myself. I created it after discussion with @warpech.

In puppet.js there is only one active socket connection per page, correct me if I am wrong. The connection has its state, it may be closed or opened, these state change events should also be visible on the Network tab.

warpech commented 9 years ago

@alemoi this is a frontend task about the new "Network" tab in starcounter-debug-aid. You can see it in Launcher since today:

screenshot 2015-04-01 11 42 11

miyconst commented 9 years ago

@warpech the bug with empty patch type for virtual url is already fixed.

tomalec commented 9 years ago

@miyconst, @warpech, could you take a look at https://github.com/PuppetJs/PuppetJs/commit/f885771759fc4ee614d41d7390141f4811eadf00#commitcomment-10604329?

miyconst commented 9 years ago

@tomalec I agree with your suggestion to remove JSON.stringify.

I made it to follow the structure of the events we already have. The event occurs about 1-2 times after page load, so it won't take much resources.

Anyway, if you think it is better to pass a single status code, I could rework it.

tomalec commented 9 years ago

I think, we can pass that._ws.readyState, event.data, upgradeURL. Other callback sends ( patches, url ) so we will not send exactly same parameters anyway. I would like to minimize overhead of events itself, as we need them only in debug mode, and we will not use them on production.

After we will implement feature to re-opening connection ,and reconfiguration, onopen and onclose may occur more often. Even now we would like to decrease time to first load to minimum, as every other part of UI waits for puppet to get the initial data.

miyconst commented 9 years ago

Okay then. I open the issue again and fix the event.