canjs / devtools

Chrome DevTools for CanJS.
https://chrome.google.com/webstore/detail/canjs-devtools/hhdfadlgplkpapjfehnjhcebebgmibcb
MIT License
5 stars 0 forks source link

Need to figure out how to correctly refresh Panel data when frames change #71

Closed phillipskevin closed 5 years ago

phillipskevin commented 5 years ago

Right now when eval is called to get data from the active frames that contain CanJS, the data is only refreshed for all frames, if no frames exist:

https://github.com/canjs/devtools/blob/838c4730e7bfde268c69878fcb99672e909721d2/canjs-devtools-helpers.mjs#L57-L64

If frames exist, each frame's data is refreshed independently: https://github.com/canjs/devtools/blob/838c4730e7bfde268c69878fcb99672e909721d2/canjs-devtools-helpers.mjs#L14-L22

This means that when the state changes from "some active frames" to "no active frames" and then back to "some active frames", the data is not loaded for the new frames. This shows the issue (notice new data is only loaded when the page is reloaded manually):

frames-noframes-frames

This logic is probably over-complicated because we want to request data independently from each frame and then only re-request the data for that frame once the data is received successfully.

I'll need to think over how to fix this.