-
Notifications
You must be signed in to change notification settings - Fork 3k
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] guard context access in then clauses #6685
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 "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use 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. |
@@ -72,7 +72,7 @@ class GoRouteInformationParser extends RouteInformationParser<RouteMatchList> { | |||
return debugParserFuture = _redirect(context, matchList) | |||
.then<RouteMatchList>((RouteMatchList value) { | |||
if (value.isError && onParserException != null) { | |||
return onParserException!(context, value); | |||
return onParserException!(context, value); // ignore: use_build_context_synchronously |
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.
@chunhtai Here and below I am actually not sure what should happen if the context has become invalid. Do you have a suggestion?
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.
if the context is invalid, it should just return a never complete future.
Something like return Completer<RouteMatchList>().future
cc @srawlins |
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.
😁
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, can you add a todo for the ignore?
|
auto label is removed for flutter/packages/6685, due to - The status or check suite Linux repo_checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
flutter/packages@5ccddfc...8de142d 2024-05-07 stuartmorgan@google.com [path_provider] Add Swift Package Manager support (flutter/packages#6680) 2024-05-07 goderbauer@google.com [go_router] guard context access in then clauses (flutter/packages#6685) 2024-05-07 engine-flutter-autoroll@skia.org Roll Flutter from 04424e1 to 7920a52 (27 revisions) (flutter/packages#6683) 2024-05-07 srawlins@google.com [camera] Ignore implementation imports outside of lib (flutter/packages#6191) 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://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
Prepares for a fix to the `use_build_context_synchronously` lint (https://dart-review.googlesource.com/c/sdk/+/365541) that will complain about these unsafe usages.
Prepares for a fix to the `use_build_context_synchronously` lint (https://dart-review.googlesource.com/c/sdk/+/365541) that will complain about these unsafe usages.
Prepares for a fix to the
use_build_context_synchronously
lint (https://dart-review.googlesource.com/c/sdk/+/365541) that will complain about these unsafe usages.