[Windows] `network.meteredConnection: auto` ignores `NetworkCostType.Fixed`
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Does this issue occur when all extensions are disabled?: Yes. The detection failure was reproduced in a fresh temporary user-data directory with `--disable-extensions` (and `--disable-updates` so that the diagnostic instance could not download an update).
- VS Code Version: 1.133.0 (User Setup, x64)
- Commit: `a5b500951314efd502d07465bd138dfbd714a960`
- Electron: 42.8.0
- OS Version: Windows 11 Enterprise, 10.0.26200, x64
- `network.meteredConnection`: `auto` (the default)
- Latest Insiders: Not tested because it is not installed. The current `main` branch still contains the same detection logic described below.
## Steps to Reproduce
1. In Windows Settings, mark the active network as a metered connection.
2. Confirm that the Windows Runtime API reports a costed connection. PowerShell 7 cannot load this WinRT type directly, so invoke Windows PowerShell 5.1 explicitly (the following command can be pasted into a PowerShell 7 terminal):
```powershell
powershell.exe -NoProfile -Command '$null = [Windows.Networking.Connectivity.NetworkInformation, Windows.Networking.Connectivity, ContentType = WindowsRuntime]; $profile = [Windows.Networking.Connectivity.NetworkInformation]::GetInternetConnectionProfile(); $profile.GetConnectionCost() | Format-List NetworkCostType, Roaming, OverDataLimit, BackgroundDataUsageRestricted'
```
On my system, `NetworkCostType` is `Fixed`. Microsoft documents `Fixed` as a connection whose use is unrestricted only up to a specific limit:
https://learn.microsoft.com/en-us/uwp/api/windows.networking.connectivity.networkcosttype
3. Set `network.meteredConnection` to `auto` in VS Code and restart VS Code.
4. Observe that the Metered Connection status bar indicator does not appear.
5. Open **Help > Toggle Developer Tools** and evaluate:
```js
({
saveData: navigator.connection?.saveData,
metered: navigator.connection?.metered,
effectiveType: navigator.connection?.effectiveType
})
```
The result on the same connection is:
```js
{ saveData: false, metered: undefined, effectiveType: '3g' }
```
## Expected Behavior
With `network.meteredConnection` set to `auto`, VS Code should recognize a connection that Windows reports as `NetworkCostType.Fixed`, show the Metered Connection indicator, and postpone automatic update downloads and other protected background operations.
## Actual Behavior
VS Code treats the connection as non-metered. No Metered Connection indicator is shown, and automatic VS Code update downloads are allowed.
This is not only a UI discrepancy. In a previous normal VS Code session, I did not invoke an update action. The log shows checks recurring hourly, followed by a download at the next scheduled check:
```text
2026-08-07 13:27:15.508 [info] update#setState checking for updates
2026-08-07 13:27:21.486 [info] update#setState idle
2026-08-07 14:27:15.511 [info] update#setState checking for updates
2026-08-07 14:27:17.875 [info] update#setState downloading
...
2026-08-07 14:28:52.102 [info] update#setState downloaded
```
Another automatic update download left a 236,665,552-byte installer in `%TEMP%\vscode-stable-user-x64`. None of the available `main.log` files contains `skipping download because connection is metered`.
## Additional Diagnostics
The current implementation of `getIsBrowserConnectionMetered()` relies on `navigator.connection`. It returns `true` only when `saveData` or `metered` is truthy, or when `effectiveType` is `2g` or `slow-2g`:
https://github.com/microsoft/vscode/blob/a5b500951314efd502d07465bd138dfbd714a960/src/vs/platform/meteredConnection/common/meteredConnection.ts#L58-L69
Chromium/Electron does not expose the Windows `NetworkCostType.Fixed` state through those values on this system, so VS Code's `auto` mode resolves to non-metered even though Windows explicitly reports the active connection as metered.
The closed test plan already notes that `navigator.connection` automatic detection "does not work well (or at all) currently," and one Windows test also reported that an update downloaded automatically:
https://github.com/microsoft/vscode/issues/297205
I could not find an open issue specifically tracking broken Windows OS metered-state detection in `auto` mode. Related implementation issue and PR:
- https://github.com/microsoft/vscode/issues/103451
- https://github.com/microsoft/vscode/pull/288919
The immediate cause might be upstream in Electron/Chromium, but the result is that VS Code's Windows `auto` mode does not honor the OS metered state. If this must be fixed upstream, it would still be useful to track the limitation here because it affects the behavior promised by this VS Code setting.
Contributor guide
Assessment
This issue has not been assessed yet.