Skip to content

Say when Flutwire may be missing calls - #9

Merged
tonytonycoder11 merged 4 commits into
mainfrom
coverage-diagnostics
Oct 24, 2026
Merged

tonytonycoder11 merged 4 commits into
mainfrom
coverage-diagnostics

Conversation

@tonytonycoder11

Copy link
Copy Markdown
Contributor

A call can be missing from the list without any sign. A client that does not use dart:io, an adapter that runs in another isolate and an HttpOverrides.global set over the capture each leave calls out silently. This adds a line above the list that says so, names the cause and says what to change.

It notices three things, and only after it has seen one happen:

  • A client that does not use dart:io. The Dio interceptor and the http client stand down for the capture, so when the capture never saw a call they stood down for, the client is named with the host it called.
  • An adapter that ran in another isolate. The main isolate listens on a named port, and an adapter that finds itself in an isolate with no recorder tells it, once per adapter and isolate. A plain dart:io call in another isolate stays out of reach, because no Flutwire code runs there.
  • A capture that was replaced. The inspector checks that HttpOverrides.current is still Flutwire's, or that a new HttpClient is still one of its clients, when it opens and whenever an adapter's call went unseen.

The line says "may be missing" and the sheet names what Flutwire saw, because it cannot know a call was lost. A replaced capture is a state that each check finds again, so its note shows no count.

New public API: Flutwire.coverage, Flutwire.watchStandDown for adapter authors, FlutwireGap, FlutwireCoverageNote and FlutwireStandDown. FlutwireSession gains coverage.

I tried all three cases on an Android emulator with the example app, which has a new Blind spots section with a probe for each, and built the example for the web. The Italian strings are under test. All four suites pass and flutter analyze --fatal-infos is clean.

Targets 0.2.0, Tier 2, M24.

A client that does not use dart:io, an adapter running in another isolate
and an HttpOverrides.global set over the capture all leave calls out of the
list with no sign that anything is missing. The engine now keeps a note for
each: it watches the calls an adapter stood down for, checks whether the
capture is still installed, and listens on a named port for adapters that
run in an isolate with no recorder.
The line opens a sheet that names each cause and says what to change, in
English and Italian. A replaced capture is a state every check finds again,
so its note does not count calls.
When the Dio interceptor or the http client stands down for the capture and
the capture does not record the call, they tell the engine which client it
was, so the inspector can name it.
The example gets a Blind spots section: a call from another isolate, a client
that does not use dart:io, and a capture that can be replaced and restored.
The README, the package pages and the changelog describe the line.
@trueup-by-nacode-studios

Copy link
Copy Markdown

This pull request adds no capability the code did not already have.

44 files read · 5087 ms · against d9d7fe4 · engine 1.4.1

@tonytonycoder11 tonytonycoder11 moved this to In progress in Flutwire Oct 24, 2026
@tonytonycoder11
tonytonycoder11 merged commit de8e99c into main Oct 24, 2026
6 checks passed
@tonytonycoder11
tonytonycoder11 deleted the coverage-diagnostics branch October 24, 2026 01:02
@tonytonycoder11 tonytonycoder11 moved this from In progress to Shipped in Flutwire Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Shipped

Development

Successfully merging this pull request may close these issues.

1 participant