Skip to content

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

@achou11

Description

@achou11

Preflight Checklist

Electron Version

37.3.0

What operating system(s) are you using?

macOS

Operating System Version

Sequoia 15.6

What arch are you using?

x64

Last Known Working Electron version

No response

Does the issue also appear in Chromium / Google Chrome?

I don't know how to test

Expected Behavior

Using Electron's net module, calling net.isOnline() or net.online within a module that's running as a utility process should reflect the actual state of the host device.

Actual Behavior

When I've disconnected wifi on the device and call net.isOnline() from within the utility process module, the result is true.

Testcase Gist URL

https://gist.github.com/achou11/159165d915505372f1450177757e9aa8

Additional Information

The gist shows the disparity between what can be determined within different processes i.e. renderer vs main vs utility. The renderer uses the NetworkInformation API while the main and utility processes use Electron's net module

When running the reproduction while disconnect from wifi, you'll noticed that the renderer and main log the expected results, whereas the utility process logs an unexpected result.

Metadata

Metadata

Assignees

Type

Projects

Status

🛠️ Fixed for Next Release

Status

🛠️ Fixed for Next Release

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions