Skip to content
This repository was archived by the owner on Oct 2, 2021. It is now read-only.

Now we keep a collection to determine if a script needs to be added, removed or changed on the client - #329

Merged
roblourens merged 1 commit into
microsoft:masterfrom
digeff:fix_loaded_scripts
May 21, 2018
Merged

roblourens merged 1 commit into
microsoft:masterfrom
digeff:fix_loaded_scripts

Conversation

@digeff

@digeff digeff commented May 17, 2018 •

Copy link
Copy Markdown
Contributor

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.

@digeff

digeff commented May 17, 2018

Copy link
Copy Markdown
Contributor Author

Raghav Katyal (@rakatyal) Can you take a look please?

@digeff
digeff force-pushed the fix_loaded_scripts branch from fa93a9b to fcb37ec Compare May 17, 2018 15:43
@digeff
digeff force-pushed the fix_loaded_scripts branch from 7ebdabf to eaa9841 Compare May 17, 2018 19:55

@rakatyal Raghav Katyal (rakatyal) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@roblourens

Copy link
Copy Markdown
Member

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.

Why does that happen?

@digeff

digeff commented May 18, 2018

Copy link
Copy Markdown
Contributor Author

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.

@auchenberg

Copy link
Copy Markdown
Contributor

Question: If this only happens in Edge, why isn't this fixed in the platform?

@digeff

digeff commented May 18, 2018

Copy link
Copy Markdown
Contributor Author

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.

@roblourens

Copy link
Copy Markdown
Member

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.

@roblourens
roblourens merged commit b80ead6 into microsoft:master May 21, 2018
@roblourens roblourens added this to the May 2018 milestone Jun 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants