Skip to content

docs(flutter): state that Dart network capture needs both the option and the overrides - #32

Merged
krassx merged 1 commit into
mainfrom
docs/flutter-network-layering
Sep 2, 2026
Merged

docs(flutter): state that Dart network capture needs both the option and the overrides#32
krassx merged 1 commit into
mainfrom
docs/flutter-network-layering

Conversation

@krassx

@krassx krassx commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Replaces #30, which GitHub auto-closed when its base branch was deleted during the stacked merge. Same commit, now based directly on main. Nothing was lost.

Resolves the open question: "is Flutter's monitorNetwork: true default meaningful without HttpOverrides.global?"

Answer: no — both are required, and neither page said so. Verified in cross/flutter and android/sdk rather than inferred from the docs.

What the code actually does

lib/src/constants.dart:12 constOptionMonitorNetwork = true
lib/src/options.dart:135 monitorNetwork ⇄ the "MonitorNetwork" key
android/src/…/BugseePlugin.java:542 put("MonitorNetwork", Options.CaptureNetwork, COERCE_BOOL) — forwarded to the native option
lib/src/networking.dart never reads the option. Dart interception is gated purely on HttpOverrides.global

A reader of configuration.md alone concludes Dart HTTP is captured by default. It is not — package:http and anything else on dart:io's HttpClient is invisible to Bugsee until the overrides are installed.

One thing I checked and was wrong about

I initially suspected the reverse was also broken — that monitorNetwork: false would fail to stop Dart traffic, since networking.dart ignores the option. That would have been a privacy hole, so I traced it rather than asserting it:

  • BugseeNetworkInterceptionCoordinator.getNetworkEventConsumer() is documented "Always non-null… the same instance for the lifetime of the process", so createNetworkEvent does not return null when capture is off.
  • But BugseeCaptureDataProviderNetwork is annotated @BugseeCaptureControllingOptions(Options.CaptureNetwork) and only subscribes to the dispatcher when started.

Net: with monitorNetwork: false the event is created and dispatched to nobody. Traffic is suppressed. The privacy page's "disabled completely" claim is correct — it just never said what "completely" covers, which this PR adds.

Changes

  • network.md — the two requirements as a numbered list, plus an :::info explaining which layer each governs.
  • configuration.md — both monitorNetwork rows cross-reference it.
  • privacy/network.md — states that disabling covers Dart and native, and wins over the overrides.

Checks

npx cspell 288 files / 0 issues · npm run build succeeds, no broken links

🤖 Generated with Claude Code

…and the overrides

/sdk/flutter/configuration listed monitorNetwork with a default of true,
while /sdk/flutter/network said the handler "has to be installed
explicitly". Read separately, the first implies Dart traffic is captured
out of the box and the second implies it is opt-in. Neither said the two
are both required.

Verified against cross/flutter and android/sdk:

- lib/src/constants.dart:12 - constOptionMonitorNetwork = true.
- lib/src/options.dart:135 - monitorNetwork maps to the "MonitorNetwork"
  key; android/src/.../BugseePlugin.java:542 forwards it to the native
  Options.CaptureNetwork.
- lib/src/networking.dart never reads the option. Dart interception is
  gated purely on HttpOverrides.global being set to
  Bugsee.defaultHttpOverrides, so without it Dart requests are never
  seen no matter what monitorNetwork says.
- Setting monitorNetwork to false does still suppress Dart traffic, just
  further down: the native capture provider is annotated
  @BugseeCaptureControllingOptions(Options.CaptureNetwork) and only
  subscribes to the network dispatcher when started, so forwarded events
  are dispatched to nobody. The privacy page's "disabled completely"
  claim is therefore accurate; it just did not say what "completely"
  covers.

So both conditions are necessary and neither page said so. network.md
now lists them as two numbered requirements with a note explaining which
layer each governs, the two configuration.md rows cross-reference it,
and privacy/network.md spells out that disabling wins over the
overrides.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Change-Id: I3d7c38346c9bd03df6b4e99dcf97356ef6415447
@krassx
krassx merged commit 47a4289 into main Sep 2, 2026
1 check passed
@krassx
krassx deleted the docs/flutter-network-layering branch September 2, 2026 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant