Repository navigation
Now we keep a collection to determine if a script needs to be added, removed or changed on the client - #329
Conversation
|
Raghav Katyal (@rakatyal) Can you take a look please? |
fa93a9b to
fcb37ec
Compare
…removed or changed on the client
7ebdabf to
eaa9841
Compare
Raghav Katyal (rakatyal)
left a comment
There was a problem hiding this comment.
As discussed offline, this is good to get rid of the 'remove script' error dialog box. However this doesn't solve the potential issues with the scripts handling logic. We should test this fix to make sure this doesn't break anything else and also discuss what we can do to simplify the handling of scripts in totality.
Why does that happen? |
|
We have a race condition between: onExecutionContextsCleared() and onScriptParsed(). When a script gets added to this._earlyScripts we can try to remove it before we add it. In Edge this happens often at the moment because of a bug when we navigate to a new page we get a onScriptParsed() for the new page before onExecutionContextsCleared() is called. I think this can probably also happen on Chrome, but I haven't seen it happen yet. |
|
Question: If this only happens in Edge, why isn't this fixed in the platform? |
|
Edge platform is fixing their bug too. I'm fixing this here because we want to get this working as soon as possible, and also because I think that this can potentially happen on Chrome too. |
|
I don't think this happens in Chrome, I think this is duplicating information that the browser should keep track of. I'm ok taking it as a workaround for the bug as long it we mark it as such. Will look at it on Monday. |
Now we keep a collection to determine if a loaded script needs to be added, removed or changed on the client.
This fixes an issue on Edge where we are trying to remove scripts that are not there, and trying to add scripts that already are there.