Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

A failure while painting the first frame bypasses the startup guard and the web smoke test

Open
#489 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
dart, flutter
Domain
frontend, testing

Research direction

Read bootstrapAndRun and runApp to understand where startup ends and the first frame is built; then inspect test/web/smoke/smoke.mjs and the existing widget tests. Add a widget test for a first-build throw and verify the web smoke test fails with the cause when MostroApp.build throws, but passes without the injected failure.

Written by the indexing model from the issue text.

Description

Follow-up from #405 (review round 3, finding 3).

What happens

bootstrapAndRun runs startup inside a guard: if anything throws, it paints StartupFailureApp naming the step and publishes the cause to the page (mostroBridgeError), which test/web/smoke/smoke.mjs reads.

runApp only schedules the app; the first frame is built afterwards. A throw during that first frame — MostroApp.build, a provider read on the first build, GoRouter's initial redirect — happens after the guard has returned, so:

  • the user gets Flutter's error widget (red in debug, grey in release) instead of the failure screen;
  • mostroBridgeReady has already been set at the end of startup (#405), so the smoke test passes.

Measured on fd94e2b: with throw StateError(...) as the first line of MostroApp.build, a release web bundle shows Flutter's grey error box and the smoke test passes — ✓ startup finished, ✓ no console or page errors. Neither the failure screen nor CI sees it.

Proposed fix

For the first frame only:

  1. Before runApp, install a FlutterError.onError that paints StartupFailureApp(step: 'showing the first screen', error: …) and calls markBridgeFailed.
  2. In addPostFrameCallback, restore the previous handler, then call markBridgeReady() — moving it from the end of _startup to after the first frame.

How to verify

  • A widget test in which the first build throws: the failure surface must be shown, with that step.
  • The web smoke test with an injected throw in MostroApp.build: it must fail with the cause, and pass without it.
Dominant language
Dart
Stars
11
Forks
9
Avg merge
21h 30m
Merged PRs (30d)
225

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MostroP2P/app

All issues in MostroP2P/app

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.