-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[go_router] fix Popping state and re-rendering scaffold at the same time doesn't update the URL on web [new] #8352
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, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). 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. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
|
example code: which contain test pop the drawer/dialog/bottomsheet. |
|
after_changed after_changed.MP4 |
|
before_change before_change.MP4 |
|
@chunhtai , it's already been updated. |
|
The unit test related to this issue has already been committed. |
…wline at the end of the file. Try adding a newline at the end of the file. • eol_at_end_of_file"
chunhtai
left a comment
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.
besides the unaddressed comment, this change LGTM
|
LGTM with some nit comments |
…he same time doesn't update the URL on web.
|
okay, it's all updated |
hannah-hyj
left a comment
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
|
how do we makes the pr as merged? |
|
Hey @ahyangnb, updating the merge conflict here should put this in a mergable state so we can finally land it. 🎊 |
|
Let me see if I can update it so we can get this merged |
…e same time doesn't update the URL on web [new] (flutter/packages#8352)
…e same time doesn't update the URL on web [new] (flutter/packages#8352)
flutter/packages@715a0a5...0ec4053 2025-06-19 [email protected] Roll Flutter from 8303a96 to 85a9b4f (93 revisions) (flutter/packages#9457) 2025-06-19 [email protected] [go_router] Update sype safe routing topic to use mixin from go_router_builder 3.0.0 (flutter/packages#9422) 2025-06-19 [email protected] [go_router] fix: PopScope.onPopInvokedWithResult not called in branch routes (flutter/packages#9245) 2025-06-18 [email protected] [pigeon] Create a message call free InstanceManager when running unit tests (flutter/packages#9395) 2025-06-18 [email protected] [go_router] Use library prefix for meta (flutter/packages#9434) 2025-06-18 [email protected] [go_router] fix Popping state and re-rendering scaffold at the same time doesn't update the URL on web [new] (flutter/packages#8352) 2025-06-18 [email protected] [camera_avfoundation] Fix incorrect types in image stream events (flutter/packages#9418) 2025-06-18 [email protected] [go_router_builder] Temporarily restrict `build` (flutter/packages#9453) 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 [email protected] 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
…ime doesn't update the URL on web [new] (flutter#8352) > the old pr flutter#6953 Change the 3 files of lib and add a example, because issue flutter/flutter#150312 The reason for the issue is when call `counterStream.increment();` will notify `notifyListeners()` of `StreamListener`, and finally affect `_handleRouteInformationProviderNotification` of` _RouterState` in `packages/flutter/lib/src/widgets/router.dart`. When pop should not call `_handleRouteInformationProviderNotification` otherwise will be path wrong. because the value of `GoRouteInformationProvider` is not the latest. ## Solution: always make the value of `GoRouteInformationProvider` knew the latest `RouteInformation`[but not to do `notifyListeners()`]. i don't know if adding `pop` to `NavigatingType` is reasonable, if any place needs to be changed please tell me. ## Result: After changed, the issue been solved and all the others pop not be affect such as drawer/dialog/bottomsheet, See the video below. > flutter/flutter#150312 > exempt from version changes > this PR is exempt from CHANGELOG changes. > this PR is test-exempt. > the `go_route_test.dart` will error if `testWidgets('throw if redirect to itself')`[I have this problem when I pull the online branch. it's not relate this PR, All of the others test success, So I view this as all test cases successfully passing.] ``` Exception has occurred. _AssertionError ('package:go_router/src/parser.dart': Failed assertion: line 110 pos 18: '!matchList.last.route.redirectOnly': A redirect-only route must redirect to location different from itself. The offending route: GoRoute#0ae4e(name: null, path: "route", Redirect Only)) ```
flutter/packages@715a0a5...0ec4053 2025-06-19 [email protected] Roll Flutter from 8303a96 to 85a9b4f (93 revisions) (flutter/packages#9457) 2025-06-19 [email protected] [go_router] Update sype safe routing topic to use mixin from go_router_builder 3.0.0 (flutter/packages#9422) 2025-06-19 [email protected] [go_router] fix: PopScope.onPopInvokedWithResult not called in branch routes (flutter/packages#9245) 2025-06-18 [email protected] [pigeon] Create a message call free InstanceManager when running unit tests (flutter/packages#9395) 2025-06-18 [email protected] [go_router] Use library prefix for meta (flutter/packages#9434) 2025-06-18 [email protected] [go_router] fix Popping state and re-rendering scaffold at the same time doesn't update the URL on web [new] (flutter/packages#8352) 2025-06-18 [email protected] [camera_avfoundation] Fix incorrect types in image stream events (flutter/packages#9418) 2025-06-18 [email protected] [go_router_builder] Temporarily restrict `build` (flutter/packages#9453) 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 [email protected] 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
…ime doesn't update the URL on web [new] (flutter#8352) > the old pr flutter#6953 Change the 3 files of lib and add a example, because issue flutter/flutter#150312 The reason for the issue is when call `counterStream.increment();` will notify `notifyListeners()` of `StreamListener`, and finally affect `_handleRouteInformationProviderNotification` of` _RouterState` in `packages/flutter/lib/src/widgets/router.dart`. When pop should not call `_handleRouteInformationProviderNotification` otherwise will be path wrong. because the value of `GoRouteInformationProvider` is not the latest. ## Solution: always make the value of `GoRouteInformationProvider` knew the latest `RouteInformation`[but not to do `notifyListeners()`]. i don't know if adding `pop` to `NavigatingType` is reasonable, if any place needs to be changed please tell me. ## Result: After changed, the issue been solved and all the others pop not be affect such as drawer/dialog/bottomsheet, See the video below. > flutter/flutter#150312 > exempt from version changes > this PR is exempt from CHANGELOG changes. > this PR is test-exempt. > the `go_route_test.dart` will error if `testWidgets('throw if redirect to itself')`[I have this problem when I pull the online branch. it's not relate this PR, All of the others test success, So I view this as all test cases successfully passing.] ``` Exception has occurred. _AssertionError ('package:go_router/src/parser.dart': Failed assertion: line 110 pos 18: '!matchList.last.route.redirectOnly': A redirect-only route must redirect to location different from itself. The offending route: GoRoute#0ae4e(name: null, path: "route", Redirect Only)) ```
Change the 3 files of lib and add a example, because issue flutter/flutter#150312
The reason for the issue is when call
counterStream.increment();will notifynotifyListeners()ofStreamListener, and finally affect_handleRouteInformationProviderNotificationof_RouterStateinpackages/flutter/lib/src/widgets/router.dart.When pop should not call
_handleRouteInformationProviderNotificationotherwise will be path wrong.because the value of
GoRouteInformationProvideris not the latest.Solution:
always make the value of
GoRouteInformationProviderknew the latestRouteInformation[but not to donotifyListeners()].i don't know if adding
poptoNavigatingTypeis reasonable, if any place needs to be changed please tell me.Result:
After changed, the issue been solved and all the others pop not be affect such as drawer/dialog/bottomsheet, See the video below.
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or this PR is exempt from CHANGELOG changes.///).