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
Revert selectable update back to be a postframecallback or microtask #125140
Conversation
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 👍
Tricky! Could this sort of bug happen anywhere else that we're using scheduleFrameCallback?
Also there is a test failure, but I think it's unrelated?
selectionControls: materialTextSelectionControls, | ||
child: SelectionSpy(key: spy), | ||
), | ||
), |
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.
Thanks for cleaning this up.
the tree breakage is unrelated, #125144 |
Ah thanks, I just saw that same failure on one of my PRs after I reviewed this. |
I didn't find too many instance of shceduleframecallback. and i think they are fine as long as they are not doing widget/rendering tree related operations |
Sounds good, I'll keep that in mind in case it comes up again. |
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 thanks for the explanation
The regression was caused by the previous pr #124624 changes postframecallback to scheduleframecallback. The reason is that if a new postframecallback was scheduled when running a postframecallback. The newly added postframecallback will be execute on the next frame. However, adding postframecallback will not schedule a new frame. So if there isn't other widget that schedule a new frame, the newly added postframecallback will never gets run.
After changing to scheduleframecallback, it causes an issue that transient callback may be called when rendering tree contains dirty layout information that are waiting to be rebuilt.
Therefore, I use microtask to get around of the postframecallback issue instead of scheduleframecallback.
fixes #125065
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.