Skip to content
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

[go_router] Secured empty matches in canPop #8557

Merged
merged 14 commits into from
Feb 26, 2025

Conversation

aprzedecki
Copy link
Contributor

@aprzedecki aprzedecki commented Feb 4, 2025

If current configuration matches is empty, canPop throws exceptions instead of quit properly

StateError: Bad state: No element
  App                 0x1086b3e80  List.last (growable_array.dart:349)
  App                 0x108996274  GoRouterDelegate.canPop (delegate.dart:84)
  App                 0x1089961bc  GoRouter.canPop (router.dart:330)
  App                 0x10899615c  BuildContextExtension|get#_shouldPop (build_context_extensions.dart:40)
  • if there are no elements, poping page throws an error

Pre-launch Checklist

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

If current configuration matches is empty, canPop throws exceptions instead of quit properly
@aprzedecki aprzedecki requested a review from chunhtai as a code owner February 4, 2025 10:00
@flutter-dashboard
Copy link

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.

Copy link

google-cla bot commented Feb 4, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@aprzedecki aprzedecki changed the title Secured empty matches in canPop [go_router] Secured empty matches in canPop Feb 4, 2025
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.

Thanks for fixing it! The fix lgtm, can you add a test to make sure we don't regress this change? it is also our policy to only accept change with a test.

While you at it, can you also bump the pubspec.yaml and changelog?

@aprzedecki aprzedecki requested a review from chunhtai February 7, 2025 09:06
@aprzedecki
Copy link
Contributor Author

Thanks for fixing it! The fix lgtm, can you add a test to make sure we don't regress this change? it is also our policy to only accept change with a test.

While you at it, can you also bump the pubspec.yaml and changelog?

Sure thing.
Ready 👌

@aprzedecki
Copy link
Contributor Author

@chunhtai are we good to go ?

@aprzedecki
Copy link
Contributor Author

@ditman maybe you can help?

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.

LGTM

@chunhtai chunhtai requested a review from hannah-hyj February 13, 2025 19:28
Copy link
Member

@hannah-hyj hannah-hyj left a comment

Choose a reason for hiding this comment

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

LGTM

@hannah-hyj hannah-hyj added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 24, 2025
@auto-submit auto-submit bot merged commit 6d191c5 into flutter:main Feb 26, 2025
82 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 27, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Feb 27, 2025
flutter/packages@c44c228...01d3d5c

2025-02-27 [email protected] Manual roll Flutter from
043b719 to 1659206 (19 revisions) (flutter/packages#8728)
2025-02-27 [email protected] Manual roll Flutter from 911aa75
to 043b719 (flutter/packages#8693)
2025-02-26 [email protected] Dependabot to update major and minor
versions of test dependencies, ignore patch (flutter/packages#8712)
2025-02-26 [email protected] [local_auth] Update to use
flutter.targetSdkVersion (flutter/packages#8695)
2025-02-26 [email protected]
[go_router_builder]: Handle invaild params (flutter/packages#8405)
2025-02-26 [email protected] [pigeon] Timestamp test steps in CI
(flutter/packages#8716)
2025-02-26 [email protected]
[camera_android_camerax] Fix 90°-off preview rotation
(flutter/packages#8629)
2025-02-26 [email protected] [go_router]
Secured empty matches in canPop (flutter/packages#8557)
2025-02-26 [email protected] [tool] Update targetsdk version to 35
from 32 (flutter/packages#8694)
2025-02-26 [email protected] [various] Bump androidx.test:core to
1.4.0 (flutter/packages#8710)
2025-02-26 [email protected] [camera] Disable flaky tests
(flutter/packages#8708)
2025-02-26 [email protected] [url_launcher][web] Prevent browser from
navigating when followLink isn't called (flutter/packages#8675)
2025-02-26 [email protected] [various] Remove plugin-level
`integration_test` dependencies (flutter/packages#8711)
2025-02-26 [email protected] [ci] Lengthen custom tests timeout
(flutter/packages#8715)

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
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.

3 participants