Skip to content

Say what led up to an error in the debug report - #559

Merged
SunkenInTime merged 4 commits into
mainfrom
t3/debug-report-context
Nov 13, 2026
Merged

SunkenInTime merged 4 commits into
mainfrom
t3/debug-report-context

Conversation

@SunkenInTime

Copy link
Copy Markdown
Owner

Before, the whole of a report a Windows user sent today (pasted through Discord, which turned :34: into an emoji):

[2026-11-13 02<:34:873953516878712882>19] INFO ...
[2026-11-13 02:41:22] ERROR [FlutterError.onError]
A UI error occurred.
Error: PlatformException(Internal Consistency Error, Set editing state has been invoked, but no client is set., null, null)
#0 JSONMethodCodec.decodeEnvelope  #1 MethodChannel._invokeMethod  <asynchronous suspension>

No version, no OS, nothing about what they were doing. We couldn't tell which text field it was or reproduce it.

After, copied from a debug build of this branch (720ca19) on Windows 11, excerpt:

Icarus Debug Report
Generated: 2026-11-13 13:56:01
App version: 5.2.0 (build 111)
Platform: windows "Windows 10 Home" 10.0 (Build 26200)
Flutter: 3.44.4
System languages: en-US, en
App language: en
Cloud: available
Account: signed out
Open strategy: none
Window: 1584x891 at 1.0x
...
13:53:46.724  canvas: addition text
13:53:53.896  text input: app sent setClient (client 1, TextInputType.multiline, view 0)
13:53:53.903  text input: app sent setEditingState (length 0, selection 0, composing none)
13:53:53.905  focus: TextField at 546,452 139x20 on PageRouteBuilder
13:54:02.218  text input: system sent updateEditingState (client 1, length 40, selection 40, composing none) x40, last 13:54:02.394
13:54:03.347  canvas: edit text
13:54:03.349  text input: app sent setEditingState (length 0, selection 0, composing none)
13:54:03.351  text input: app sent clearClient

The last commit, made from reading this report, changes the header to say Windows 11 Home (Windows calls itself 10 to programs), the build mode (build 111, debug), which cloud (Cloud: development, started), and the UTC offset after Generated.

That trace already shows something worth a look: when the canvas text box loses focus after 40 typed characters, the app sends Windows an empty editing state just before letting go of the field. That's the kind of ordering the user's error is about. Following it up is separate work.

What a report now carries

  • A header: app version, build mode, platform (Windows 11 named as such; Windows calls itself 10 to programs), Flutter version, system and app language, which cloud and whether it started, signed in or out, the open strategy (local or cloud, saved or not), window size, and the time zone.
  • Where a UI error happened, in Flutter's words: "A UI error occurred while setting text input editing state. (services library)". Only the widget's type is kept: a widget's key follows its name there, and a placed text's key is its text.
  • What led up to it. An in-memory trail of the last 60 steps, attached to every error entry (above its stack) and printed at the end of the report:
    • focus moving between fields: the field's kind, its hint if it has one, where it is, page or dialog
    • the window going to the background and back
    • canvas edits, undo and redo; opening a strategy and switching pages
    • every message between a text field and the system's text input (setClient, setEditingState, clearClient, and what the system sends back), with lengths and selections instead of text, and any message the system refuses
  • A code fence around the copied report, so Discord and Markdown show it as written.

The text input trace is a binding whose messenger passes every platform message through unchanged and notes the text input ones (lib/services/text_input_trace.dart). It returns the original reply future and the original handler result, so callers see the same timing.

Nothing typed reaches the trail: tests type into fields and check the text never appears. Repeats collapse to one line with a count, so 40 keystrokes are one line.

How far this got

  • Windows 11, debug build, real mouse and keyboard (Astra): placed and edited canvas text, added and switched pages, renamed the title, searched the library, then hit a real error going Home. The report copied cleanly, with the trail attached to each error and nothing typed in it.
  • That run found that the first version broke startup (the strategy listener ran before the cloud was set up); it now starts after the first frame and can't stop the app starting. A focus step on a field not yet laid out also threw; it now says so instead. Both were seen fixed: Windows started cleanly, and the web build started and took focus changes with no errors.
  • The last commit (Windows 11 name, build mode, time zone, steps above the stack, quieter trace, hints) was checked by tests, not by another Windows run.
  • flutter test passes in full (3,799 tests).

Not covered: an IME (Japanese or Chinese input), and the report from a signed-in cloud session.

ci: analyze test web

A report now opens with the build, platform, language and session (signed
in or not, local or cloud strategy, window size), keeps where Flutter says
an error happened, and lists the recent steps before it: focus moving
between fields, the window going to the background, canvas edits,
undo/redo, strategy and page switches, and every message between text
fields and the system's text input, with lengths instead of text.

The copied report is fenced as a code block so Discord and Markdown show
it as written.
A widget's key follows its name in Flutter's error context, and a placed
text's key is its text; Flutter's longer description can quote text on
screen. Keep the context up to the key and leave the description out.
Watching the strategy from the start of main made it before the cloud
was set up, and it reads the session as soon as it exists, so startup
failed on Supabase not being initialized. It now starts after the first
frame and can only cost the trail its strategy steps.

Focus can also move to a field before it is laid out; the focus step
says so instead of asking it for a position it doesn't have yet.
From a real report on Windows 11: call it Windows 11 (Windows names
itself 10 to programs), say whether the build is debug or release and
which cloud it talks to, give the report's time zone, put the steps
before an error's stack instead of after hundreds of frames, keep 60
steps and leave out show, hide and autofill messages, which crowded
them out, and name a field by its hint when it has one.
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bc403acc-7d28-491d-b4ac-c972383c0da6
Commits

Reviewing files that changed from the base of the PR and between ec3fdb5 and 3c5142f.

Files selected for processing: 10

  • lib/main.dart
  • lib/providers/action_provider.dart
  • lib/providers/in_app_debug_provider.dart
  • lib/services/app_error_reporter.dart
  • lib/services/debug_breadcrumb_sources.dart
  • lib/services/debug_breadcrumbs.dart
  • lib/services/text_input_trace.dart
  • lib/services/vision_boundary_asset_writer.dart
  • lib/services/windows_desktop_update_restart_service.dart
  • test/services/debug_report_context_test.dart
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@SunkenInTime
SunkenInTime merged commit e4cf9cc into main Nov 13, 2026
20 checks passed
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