A failure while painting the first frame bypasses the startup guard and the web smoke test
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
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;
mostroBridgeReadyhas 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:
- Before
runApp, install aFlutterError.onErrorthat paintsStartupFailureApp(step: 'showing the first screen', error: …)and callsmarkBridgeFailed. - In
addPostFrameCallback, restore the previous handler, then callmarkBridgeReady()— moving it from the end of_startupto 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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MostroP2P/app
-
area: ui feature priority: medium
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
area: rust-core bug priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
area: ui
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 65/100
chriskelly/wish-together#36 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
AppFlowy-IO/AppFlowy#9075 ·
-
Paste asks for iOS paste permission because the default context menu ignores SystemContextMenuPossibly taken @dorklein claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
maheshj01/searchfield#267 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
hajisensai/Fushi#2340 · 2 comments ·
Maintainers usually reply within 1 day