-
Notifications
You must be signed in to change notification settings - Fork 29.4k
[CP-stable]Make _layoutBoundary a boolean 2 #171106
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
[CP-stable]Make _layoutBoundary a boolean 2 #171106
Conversation
flutter#169638, without the more risky changes. I'll try to fix the g3 failures and land flutter#169638 later. ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
@LongCatIsLooong please fill out the PR description above, afterwards the release team will review this request. |
This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter. Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed. |
@LongCatIsLooong You will need to push a blank commit to have the tests re-run, and assuming they pass, we can merge. It will not make it in this weeks' release. |
This is automatically generated by flutteractionsbot so I don't know how to push a new commit. Does it work if I manually rerun using the github UI, or close this PR and add the CP label to the fix PR again so the bot creates a new PR? |
If you want to rerun 31 tasks manually, sure. Otherwise you should have permissions to push commits to this branch as a maintainer (similar to how you could for another person's PR). If you aren't sure how I'd ask someone on your team, but you would checkout the branch and commit to it. |
Are there any updates on this? Please and thank you |
@matanlurey Looks like all checks are passed. Why can't we approve it? It's a blocker for my app and we need it on the stable channel |
+1... I honestly don't understand how this is not a priority and a bug fix is released immediately. This has been broken for quite a bit now, and it is not a minor issue. It causes widgets to directly not render at all |
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
d779fc7
into
flutter:flutter-3.32-candidate.0
This pull request is created by automatic cherry pick workflow
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.
Issue Link:
What is the link to the issue this cherry-pick is addressing?
#168936.
Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See best practices for examples
Fixes a "Null check operator used on a null value" crash when a scroll view contains a
LayoutBuilder
.Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch)
The app may crash if there a
LayoutBuilder
child inside of aRenderSliverMultiBoxAdaptor
(whichSliverList
uses), and that child suddenly becomes offstage and kept-alive.One example is when you have a TextField inside of a LayoutBuilder which is part of a
SliverList
. The app crashes ("Null check operator used on a null value") even in release mode when the user drags so that the text field becomes offscreen. All 3 are popular widgets so I think this combination will not be that uncommon.Workaround:
Is there a workaround for this issue?
There's no known workaround for this issue. You can increase the cache extent to prevent the child from becoming kept-alive but this is not really feasible for long / infinite list as it will go OOM fast.
Risk:
What is the risk level of this cherry-pick?
This should be a relatively safe fix.
Despite changing an important flag in RenderObject from
RenderObject?
tobool?
, there's only one change in behavior:in
RenderObject.dropChild
: https://github.com/flutter/flutter/pull/169958/files#diff-4c298197a8aa7831a26eece096c8b8b07773ba1f5376d848ea4ef2924b606e9fL2052which originally set the flag to
null
for the entire subtree until a new relayout boundary is reached, now it only sets the flag tonull
for the root of the subtree.In release mode, the only place the framework cares about whether the flag is null is here (everywhere else
null
just meansfalse
), and that won't actually introduce any correctness issues because if the node originally enters theif
block in line 2343 it will still enter theif
block after the patch.Also, the fix was merged a couple weeks ago and I haven't seen bug reports associated with the fix yet.
Test Coverage:
Are you confident that your fix is well-tested by automated tests?
Validation Steps:
What are the steps to validate that this fix works?
follow the repro steps in #168936, or
run the test (already checked in in
master
)