Skip to content

Protect against null context in action invoke in release mode #64474

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

Merged
merged 1 commit into from
Aug 25, 2020

Conversation

gspencergoog
Copy link
Contributor

@gspencergoog gspencergoog commented Aug 24, 2020

Description

Add some protection against a crash in release mode. The working theory at the moment is that it happens in some kind of race when removing widgets from the tree, where the primary focus context could be null.

Related Issues

Tests

  • Unable to make a regression test for this, since it only happens in release mode: any test would assert long before arriving at the point where this would crash.

@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Aug 24, 2020
@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 to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

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

Generally speaking, we don't make this kind of fix, since we don't really understand the cause and so we can't really produce a regression test. Perhaps the original issue should be left open (without the P3 priority) until we have sorted out the cause.

@gspencergoog gspencergoog changed the title Protect against null context in release mode Protect against null context in action invoke in release mode Aug 25, 2020
@gspencergoog
Copy link
Contributor Author

Hans and I chatted, and decided that this is the best compromise at the moment. We're both uncomfortable with not having a regression test, but the (non-starter) alternative is to leave the bug in the code to get a better reproduction case. Since the code will already assert when this happens, we can find reproduction cases in debug builds just as usefully without impacting the customer.

I'm going to leave the bug open while we explore ways to get a reproduction case on a debug build (which will assert).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants