Skip to content

[go_router] Stop state lookup from revisiting a navigator - #13883

Draft
GianSandoval5 wants to merge 1 commit into
flutter:mainfrom
GianSandoval5:fix/go-router-state-lookup-197930
Draft

GianSandoval5 wants to merge 1 commit into
flutter:mainfrom
GianSandoval5:fix/go-router-state-lookup-197930

Conversation

@GianSandoval5

Copy link
Copy Markdown

When a page first reads GoRouterState.of(context) during its exit transition inside a ShellRoute, its page may already be absent from the registry. The fallback reaches the enclosing Navigator's own context, which resolves to that same Navigator forever.

Stop that non-progressing lookup with the existing GoError. Previously associated states still resolve during exit. This does not extend registry lifetimes or promise a state for an unregistered closing page.

Fixes flutter/flutter#197930

Adds five regressions: first lookup during root/shell exit, previously associated state during root/shell exit, and lookup from a shell Navigator's own context. Includes a pending patch changelog for release:batch:true.

Validation

  • Ubuntu 22.04; Flutter 3.50.1 (ae9b586f34a8443573f82ef57c3bf914a908cbf7), Dart 3.14.0; upstream base 1c37984f588afbebd027b58fe7d45094b97779c8.
  • Baseline root control passes. The new shell-exit regression starts and then reaches an external 45-second timeout (exit 124) on unchanged production source.
  • Applying only the production builder.dart change from [go_router] Keep shell navigator state when a parent shell moves it #13565 at 1f5e0ce7e8f57f982a2008d7434a92925b527084 still hangs in that regression (exit 124). That comparative third-party patch is excluded from this PR. This addresses the separate non-progressing Navigator lookup, not [go_router] Keep shell navigator state when a parent shell moves it #13565's association change.
  • Patched complete go_router widget suite: 496 passed, 0 failed, 0 skipped, exit 0.
  • Repository format, strict analysis, validate, license-check and publish-check (dry run) pass; sources remain unchanged after checks.
  • Evidence: https://github.com/GianSandoval5/packages/actions/runs/47336650551 . Package tree cd630b5bf1ea441058504ce4155f63790455ed84 is identical between that validation commit and this functional commit. CI instrumentation is kept on a separate fork branch.
  • The first run failed strict analysis for a missing explicit local type in the new test; the type was added and checks rerun. No validation was disabled.
  • No Android/iOS app, browser or visual production reproduction was run. These are Linux widget tests of shared Dart behavior, not native platform validation.

AI-assisted preparation. Kept as draft for Gian's personal review and project review; the personal checklist below is intentionally unmarked. No agreement has been signed on the contributor's behalf. A previous PR's CLA result is not asserted as this PR's CLA result.

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[go_router] GoRouterState.of loops forever on a page that is closing inside a ShellRoute

1 participant