Repository navigation
Commit 18a9c45
authored
[go_router] Fix redirect zone async error handling (flutter#12836)
Fixes flutter#192066
## Summary
Replaces the guarded redirect zone with a value-only zone when running redirect callbacks.
Redirect callbacks still have access to the current router through zone values, so APIs such as `GoRouter.of(context)` and `context.namedLocation(...)`
continue to work during redirects. However, unrelated unawaited async errors started during a redirect are no longer caught by go_router and wrapped as
`GoException`.
## Tests
- `fvm dart run ../../script/tool/bin/flutter_plugin_tools.dart format --packages go_router`
- `fvm dart run ../../script/tool/bin/flutter_plugin_tools.dart analyze --packages go_router`
- `fvm dart run ../../script/tool/bin/flutter_plugin_tools.dart dart-test --packages go_router`
- `fvm dart run ../../script/tool/bin/flutter_plugin_tools.dart validate --packages go_router`
- `fvm flutter test test/go_router_test.dart`
- `fvm flutter test test/redirect_chain_test.dart`
For the checklist, check the ones that are true:1 parent 9bc15a0 commit 18a9c45
3 files changed
Lines changed: 43 additions & 24 deletions
File tree
- packages/go_router
- lib/src
- pending_changelogs
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
652 | 631 | | |
653 | 632 | | |
654 | 633 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2063 | 2063 | | |
2064 | 2064 | | |
2065 | 2065 | | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
2066 | 2103 | | |
2067 | 2104 | | |
2068 | 2105 | | |
| |||
0 commit comments