Skip to content

[go_router] Fix assertion failure on URLs with hash fragments missing leading slash - #11431

Merged
auto-submit[bot] merged 3 commits into
flutter:mainfrom
chunhtai:fix-assertion-missing-slash
Apr 21, 2026
Merged

[go_router] Fix assertion failure on URLs with hash fragments missing leading slash#11431
auto-submit[bot] merged 3 commits into
flutter:mainfrom
chunhtai:fix-assertion-missing-slash

Conversation

@chunhtai

@chunhtaichunhtai commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

@github-actionsgithub-actionsBot added p: go_router triage-framework Should be looked at in framework triage labels Apr 3, 2026

@gemini-code-assistgemini-code-assistBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies RouteConfiguration.normalizeUri to ensure paths consistently start with a leading slash and removes trailing slashes for paths longer than one character. It includes new unit and widget tests to verify these changes and ensure that query parameters and fragments are preserved. A review comment suggests optimizing the normalization process by returning the original URI when no path changes are required to avoid unnecessary object allocation.

Comment threadpackages/go_router/lib/src/configuration.dart
@chunhtai
chunhtai requested a review from hannah-hyjApril 3, 2026 20:15
@chunhtaichunhtai added the CICD Run CI/CD label Apr 3, 2026

@hannah-hyjhannah-hyj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chunhtai
chunhtaiforce-pushed the fix-assertion-missing-slash branch from f5a9d3a to 65d4f39CompareApril 21, 2026 22:45
@github-actionsgithub-actionsBot removed the CICD Run CI/CD label Apr 21, 2026
@chunhtaichunhtai added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Apr 21, 2026
@auto-submit
auto-submitBot merged commit 4a2091d into flutter:mainApr 21, 2026
83 checks passed
vashworth pushed a commit to vashworth/flutter that referenced this pull request Apr 22, 2026
…r#185417)
flutter/packages@7c8e13e...4a2091d
2026-04-21 47866232+chunhtai@users.noreply.github.com [go_router] Fix
assertion failure on URLs with hash fragments missing leading slash
(flutter/packages#11431)
2026-04-21 10687576+bparrishMines@users.noreply.github.com
[webview_flutter_wkwebview] Tear down ProxyAPIRegistrar in
`applicationWillTerminate` (flutter/packages#11484)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.
To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmitMerge PR when tree becomes green via auto submit AppCICDRun CI/CDp: go_routertriage-frameworkShould be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[go_router] Assertion error when navigating to hash fragments without leading slash go_router match failure for an URI without a / character

2 participants

@chunhtai@hannah-hyj