-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[go_router] #127016 preserved route name case when caching _nameToPath
#4196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you write a test to make sure we don't break it accidentally?
packages/go_router/CHANGELOG.md
Outdated
- Preserves route name case when caching `_nameToPath` by not using `toLowerCase()`.<br> | ||
this is useful to make route names case sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Preserves route name case when caching `_nameToPath` by not using `toLowerCase()`.<br> | |
this is useful to make route names case sensitive | |
- Makes namedLocation and route name related APIs case sensitive. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, will write the test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the test and modified the changelog as suggested.
Do you have any other comments or suggestions in mind?
Thanks ✌️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, some suggestions on test
); | ||
|
||
// go to ScreenB | ||
navKey.currentContext!.goNamed('name'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
navKey.currentContext!.goNamed('name'); | |
router.goNamed('name'); |
|
||
// go to ScreenB | ||
navKey.currentContext!.goNamed('name'); | ||
assert(GoRouter.of(navKey.currentContext!).location == '/path'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert(GoRouter.of(navKey.currentContext!).location == '/path'); | |
expect(find.byType(ScreenB), findsOneWidget); |
assert(GoRouter.of(navKey.currentContext!).location == '/path'); | ||
|
||
// go to ScreenA | ||
navKey.currentContext!.goNamed('Name'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
navKey.currentContext!.goNamed('Name'); | |
router.goNamed('Name'); |
|
||
// go to ScreenA | ||
navKey.currentContext!.goNamed('Name'); | ||
assert(GoRouter.of(navKey.currentContext!).location == '/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(find.byType(ScreenA), findsOneWidget);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions are applied, thanks ✌️
Looks like some other tests are failing |
@chunhtai Tests are fixed now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@chunhtai , @Hangyujin |
The ci was acting weird, I think the action item is on the flutter team to fix it. |
Do they know about the issue? or do we need to raise a flag somehow? |
It is released now, thank guys for your cooperation ✌️ |
…hing `_nameToPath` (flutter/packages#4196)
flutter/packages@0507297...f9314a3 2023-06-14 stuartmorgan@google.com [tool] Support running main.dart (flutter/packages#4208) 2023-06-13 stuartmorgan@google.com [tool] Allow running from anywhere (flutter/packages#4199) 2023-06-13 62033170+Khalidm98@users.noreply.github.com [go_router] #127016 preserved route name case when caching `_nameToPath` (flutter/packages#4196) 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,rmistry@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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
preserved route name case when caching
_nameToPath
by not usingtoLowerCase()
Related issue:
#127016