-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Clean up Live Development agent loading #3203
Clean up Live Development agent loading #3203
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When playing round with disabling the DOMAgent, I discovered that the CSSAgent and RemoteAgent both depend on Inspector.Page being enabled so they get the loadEventFired event, so this needs to be moved out of DOMAgent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This issue is captured in #2599, but I thought I'd mention it here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved Inspector.Page.enable() to LiveDevelopment onInterstitialPageLoad.
|
In |
|
I don't think we want to take this for Sprint 22. Those are all of the comments I had. |
…t-loading Conflicts: src/LiveDevelopment/Agents/RemoteFunctions.js
|
I think the requested changes to It shouldn't matter that the addition to Unfortunately, there is yet another problematic race between |
|
I agree that the issue I have with the |
|
According to the text of I agree that this function sucks, but I don't immediately know how/have time to fix it the right way. I think a new bug is appropriate here. The changes in this patch don't introduce any new problems with this function (as far as I can tell) because some agents are already loading asynchronously. |
|
I opened a new issue for the |
|
@jasonsanjose It sounds like the changes in this pull requests are related to the Live Dev research you are doing. I was hoping to merge this soon, so let me know if I should hold off. |
|
Thanks for the heads up. I'll let you know soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding a callback each time (as shown here) I was wondering if we could update Inspector._send to always return a promise if no explicit callback is specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose so. I don't have a good feeling though for whether that can be done reliably across all API calls and whether that would have any other ramifications.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that makes a lot of sense. If you're bangin' away on Live Development this sprint, you might also take a look at the race I mentioned a few comments up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably won't dig into the loadAgents/unloadAgents race condition here since it doesn't immediately impact the Chrome 27 bug as far as I know. Randy did file a new bug #3390, so I'll reference your comment there.
|
Closing this pull request to manually reconcile with #3442. |
Currently, Live Development agents resolve their
load()promises before remote services they rely on have been completely enabled. For example,NetworkAgent.load()callsInspector.Network.enable()but does not wait for this asynchronous call to complete before returning. This pull request delays completion of these load calls until the necessary asynchronous calls have successfully completed.I'm not aware of any problems caused by the current behavior, but fewer race conditions seems better than more race conditions. Startup races like this also tend to manifest themselves during automated testing.