这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@justinmc
Copy link
Contributor

This test was failing in flutter/flutter#152330. That PR adds a PopScope inside of nested Navigators. When a back gesture happens, the PopScope takes 1 frame to rerender and update the state of its pop handling. The test was breaking because it performed two back gestures in one frame. Putting a pump in between them fixes it when the PR is merged (and works fine without the PR too).

It took me so many hours to realize this one little pump was the fix I needed 😭 .

@justinmc justinmc self-assigned this Aug 20, 2025
@justinmc justinmc requested a review from chunhtai as a code owner August 20, 2025 05:58
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

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 addresses a test failure related to PopScope behavior by introducing a single tester.pump() call in packages/go_router/test/go_router_test.dart. The change is located within a test that simulates multiple back button presses and ensures that PopScope widgets have a frame to rebuild their state between gestures. The change is well-contained and the accompanying comment clearly explains its purpose. I find the change to be correct and have no further recommendations.

@justinmc justinmc force-pushed the automatic-pop-scope-fix branch 3 times, most recently from bc8c463 to fa5a567 Compare August 20, 2025 16:54
Needs one frame for PopScope to rerender after the navigation state
changes.
@justinmc justinmc force-pushed the automatic-pop-scope-fix branch from fa5a567 to 7af232b Compare August 20, 2025 16:55
Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

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

nice detective work, LGTM

@justinmc justinmc added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 21, 2025
@auto-submit auto-submit bot merged commit f0769e6 into flutter:main Aug 21, 2025
80 checks passed
@justinmc justinmc deleted the automatic-pop-scope-fix branch August 21, 2025 19:16
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 22, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 22, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Aug 22, 2025
flutter/packages@58c02e0...092d832

2025-08-21 engine-flutter-autoroll@skia.org Roll Flutter from
960d107 to d2ac021 (12 revisions) (flutter/packages#9866)
2025-08-21 jmccandless@google.com Handle automatic PopScope
(flutter/packages#9856)
2025-08-20 engine-flutter-autoroll@skia.org Manual roll Flutter from
e65380a to 960d107 (36 revisions) (flutter/packages#9862)
2025-08-20 10687576+bparrishMines@users.noreply.github.com
[interactive_media_ads] Updates ProxyApis to prepare to add support for
`AdEvent.ad` (flutter/packages#9785)

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
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
…r#174295)

flutter/packages@58c02e0...092d832

2025-08-21 engine-flutter-autoroll@skia.org Roll Flutter from
960d107 to d2ac021 (12 revisions) (flutter/packages#9866)
2025-08-21 jmccandless@google.com Handle automatic PopScope
(flutter/packages#9856)
2025-08-20 engine-flutter-autoroll@skia.org Manual roll Flutter from
e65380a to 960d107 (36 revisions) (flutter/packages#9862)
2025-08-20 10687576+bparrishMines@users.noreply.github.com
[interactive_media_ads] Updates ProxyApis to prepare to add support for
`AdEvent.ad` (flutter/packages#9785)

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
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
…r#174295)

flutter/packages@58c02e0...092d832

2025-08-21 engine-flutter-autoroll@skia.org Roll Flutter from
960d107 to d2ac021 (12 revisions) (flutter/packages#9866)
2025-08-21 jmccandless@google.com Handle automatic PopScope
(flutter/packages#9856)
2025-08-20 engine-flutter-autoroll@skia.org Manual roll Flutter from
e65380a to 960d107 (36 revisions) (flutter/packages#9862)
2025-08-20 10687576+bparrishMines@users.noreply.github.com
[interactive_media_ads] Updates ProxyApis to prepare to add support for
`AdEvent.ad` (flutter/packages#9785)

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
Jaineel-Mamtora pushed a commit to Jaineel-Mamtora/flutter_forked that referenced this pull request Sep 24, 2025
…r#174295)

flutter/packages@58c02e0...092d832

2025-08-21 engine-flutter-autoroll@skia.org Roll Flutter from
960d107 to d2ac021 (12 revisions) (flutter/packages#9866)
2025-08-21 jmccandless@google.com Handle automatic PopScope
(flutter/packages#9856)
2025-08-20 engine-flutter-autoroll@skia.org Manual roll Flutter from
e65380a to 960d107 (36 revisions) (flutter/packages#9862)
2025-08-20 10687576+bparrishMines@users.noreply.github.com
[interactive_media_ads] Updates ProxyApis to prepare to add support for
`AdEvent.ad` (flutter/packages#9785)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: go_router

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants