New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle a race condition between preload scripts executing and navigations #17577
Conversation
navigations There is a race condition between DidCreateScriptContext and another navigation occuring in the main process. If the navigation occurs while the preload script is running, the same process is re-used. This ensures that any pending navigations are completely removed / ignored when we trigger a new navigation. Fixes #17576
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 patch seems fine, since we already expect to discard non committed entries through params.should_clear_history_list
, the race condition described in this PR might be why that isn't achieved. Having an explicit call, looks good.
Release Notes Persisted
|
I have automatically backported this PR to "3-1-x", please check out #17595 |
I have automatically backported this PR to "4-1-x", please check out #17596 |
I have automatically backported this PR to "5-0-x", please check out #17597 |
…lectron#17577) navigations There is a race condition between DidCreateScriptContext and another navigation occuring in the main process. If the navigation occurs while the preload script is running, the same process is re-used. This ensures that any pending navigations are completely removed / ignored when we trigger a new navigation. Fixes electron#17576
There is a race condition between DidCreateScriptContext and another navigation occuring in the main process. If the navigation occurs while the preload script is running, the same process is re-used. This ensures that any pending navigations are completely removed / ignored when we trigger a new navigation.
Refs #17576
Please note that although this refs #17576 it does not completely fix that issue, it makes it way harder to occur but it could still occur. This is the quick fix, I'll be following up with another patch later to fix this / patch over this in the NavigationController impl in Chromium.
Release Notes
Notes: Fixed issue where preload scripts would sometimes run twice in the same process in different contexts resulting in broken native node module loading.