Repository navigation
Report Python startup errors in flet test; bump Flutter to 3.47.8 - #7023
Merged
Merged
Conversation
When the app's Python program failed before connecting, such as an import error, the build template reported it only on the boot screen's status. `waitForAppLoaded` checked only `FletBackend.error`, so `flet test` waited out its two-minute timeout and failed with "The app did not load its first page", without the traceback. `waitForAppLoaded` now also checks the backend's boot status and fails right away with the error text, so the test output includes the Python traceback.
Contributor
|
Sorry @ndonkoHenri, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 1 day and 22 hours by commenting |
Deploying flet-website-v2 with
|
| Latest commit: |
24fd5ec
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://735e9f3e.flet-website-v2.pages.dev |
| Branch Preview URL: | https://fix-flet-test-python-startup.flet-website-v2.pages.dev |
`use_ref(initial_value: RefValueT | Callable[[], RefValueT] | None = None)` put the TypeVar on both sides of a union, as `use_state()` did before #7014: mypy rejected a function initializer and fell back to `Any`, and ty inferred the function-or-value union. Overloads now match a zero-argument function first, keep the original union as the fallback so value-or-function arguments passed through by custom hooks type as before, and give `use_ref()` / `use_ref(None)` a `MutableRef[Any]` that can be assigned later.
FeodorFitsner
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three independent changes for 1.1.0.
Report Python startup errors in
flet testWhen the app's Python program fails before it connects, for example on an import error,
flet testwaited out its two-minute startup timeout and failed with only:The traceback was only visible in the app window, so the reporter of #7022 added a
sleepto their test to read it.The build template reports a Python program that exits early on the boot status that draws the "Error running app" screen.
waitForAppLoaded(added in #6995) only checkedFletBackend.error, which is set by errors that arrive over the Flet protocol, so it never saw it. It now also checks the backend'sbootStatusand fails right away with the error text:Tested on Windows 11 with a Flet 1.1.0 project built from source whose
main.pyimportspydantic(which fails there because of flet-dev/serious-python#261): without-v, the failing test prints the traceback above instead of the timeout.app_startup_test.dartgets a case for an error reported only on the boot status while the backend is still loading; all 6 tests pass.An error raised before
FletAppis built, such as a failure while the app bundle is prepared, still times out: the driver can't reach the boot status at that point.Bump Flutter to 3.47.8
.fvmrc3.47.7 → 3.47.8 (Dart 3.13.5 → 3.13.7, and twoflutter_toolscrash fixes).pub getinclient,packages/fletandpackages/flet_integration_testleaves every lock file unchanged. The changelog link points at#3478, which Flutter's stable changelog doesn't have a section for yet.Type
use_ref()with a function initializerThe
use_ref()half of #6960, which #7014 fixed foruse_state()only.use_ref(initial_value: RefValueT | Callable[[], RefValueT] | None = None)put the TypeVar on both sides of a union, soft.use_ref(create_state)was an error in mypy (falling back toAny) and the function-or-value union in ty. Three overloads, matching theuse_state()ones:use_ref(create_state)→MutableRef[FormState].use_ref()anduse_ref(None)giveMutableRef[Any], so an empty ref can be assigned later.mypy, pyright and ty report 0 errors for these cases,
use_state(create_state)still givesFormState, and the hook unit tests pass. The runtime is unchanged. The #6960 changelog entry now covers both hooks.Summary by Sourcery
Improve startup failure reporting in
flet testand update the bundled Flutter SDK to 3.47.8.Bug Fixes:
flet testreport Python startup tracebacks immediately instead of waiting for the app startup timeout.use_ref().Enhancements:
Build:
Tests: