Skip to content

fix: net.isOnline always true in utility processes#48111

Merged
codebytere merged 2 commits intomainfrom
fix-missing-network-change-notifier
Aug 22, 2025
Merged

fix: net.isOnline always true in utility processes#48111
codebytere merged 2 commits intomainfrom
fix-missing-network-change-notifier

Conversation

@codebytere
Copy link
Copy Markdown
Member

Description of Change

Closes #48100.

Fixes an issue where net.isOnline() always returned true in utilityProcesses. This happened because utility processes never created a net::NetworkChangeNotifier, so net.isOnline() always saw a null global and defaulted to “online”.

Fix this by adding a per‑utility‑process NetworkChangeNotifier during NodeService::Initialize()], allowing net.isOnline() to reflect real connectivity.

Checklist

Release Notes

Notes: Fixed an issue where net.isOnline() always returned true in utilityProcesses.

@codebytere codebytere requested a review from deepak1556 August 19, 2025 09:51
@codebytere codebytere added semver/patch backwards-compatible bug fixes target/36-x-y PR should also be added to the "36-x-y" branch. target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. labels Aug 19, 2025
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Aug 19, 2025
@codebytere codebytere changed the title fix: net.isOnline always true in utilityProcesses fix: net.isOnline always true in utility orocesses Aug 19, 2025
@codebytere codebytere changed the title fix: net.isOnline always true in utility orocesses fix: net.isOnline always true in utility processes Aug 19, 2025
@codebytere codebytere force-pushed the fix-missing-network-change-notifier branch from 45c52a4 to 6a57fc5 Compare August 19, 2025 09:54
Comment thread shell/services/node/node_service.cc Outdated
Copy link
Copy Markdown
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

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

LGTM

@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Aug 20, 2025
@codebytere codebytere force-pushed the fix-missing-network-change-notifier branch from 4162760 to ce3fa89 Compare August 21, 2025 14:54
@codebytere codebytere merged commit 6101025 into main Aug 22, 2025
100 of 103 checks passed
@codebytere codebytere deleted the fix-missing-network-change-notifier branch August 22, 2025 12:30
@release-clerk
Copy link
Copy Markdown

release-clerk Bot commented Aug 22, 2025

Release Notes Persisted

Fixed an issue where net.isOnline() always returned true in utilityProcesses.

@trop
Copy link
Copy Markdown
Contributor

trop Bot commented Aug 22, 2025

I have automatically backported this PR to "38-x-y", please check out #48151

@trop trop Bot removed the target/38-x-y PR should also be added to the "38-x-y" branch. label Aug 22, 2025
@trop
Copy link
Copy Markdown
Contributor

trop Bot commented Aug 22, 2025

I have automatically backported this PR to "37-x-y", please check out #48152

@trop
Copy link
Copy Markdown
Contributor

trop Bot commented Aug 22, 2025

I have automatically backported this PR to "36-x-y", please check out #48153

@trop trop Bot added in-flight/37-x-y in-flight/36-x-y and removed target/37-x-y PR should also be added to the "37-x-y" branch. labels Aug 22, 2025
@trop trop Bot added merged/37-x-y PR was merged to the "37-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. merged/36-x-y PR was merged to the "36-x-y" branch. and removed target/36-x-y PR should also be added to the "36-x-y" branch. in-flight/37-x-y in-flight/38-x-y in-flight/36-x-y labels Aug 22, 2025
dodolalorc pushed a commit to dodolalorc/electron that referenced this pull request Sep 11, 2025
* fix: net.isOnline always true in utilityProcesses

* Update shell/services/node/node_service.cc

Co-authored-by: Robo <hop2deep@gmail.com>

---------

Co-authored-by: Robo <hop2deep@gmail.com>
kigh-ota pushed a commit to kigh-ota/electron that referenced this pull request Sep 30, 2025
* fix: net.isOnline always true in utilityProcesses

* Update shell/services/node/node_service.cc

Co-authored-by: Robo <hop2deep@gmail.com>

---------

Co-authored-by: Robo <hop2deep@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/36-x-y PR was merged to the "36-x-y" branch. merged/37-x-y PR was merged to the "37-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

net.isOnline()/net.online always returns true when called from module running as a utility process.

3 participants