-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Make TabController communicating creation in constructor. #144912
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
Make TabController communicating creation in constructor. #144912
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. |
|
Test coverage is not needed because this PR is to improve troubleshooting. |
|
I don't quite understand why we wouldn't want to test this? It seems like we should test that all ChangeNotifiers are properly calling this. After all, if someone removes this code, that is a regression we would want to catch, no? |
Removal of this code will result in more complicated troubleshooting, but no regression. ChangeNotifiers that leaks make this call anyway in 'addListener'. Making it in constructor instead will make troubleshooting easier, because will give creation call stack for a leaking object. See description: https://github.com/dart-lang/leak_tracker/blob/main/doc/leak_tracking/TROUBLESHOOT.md#1-it-is-not-clear-who-owns-changenotifier It is hard to test cover, because the class is internal and complexity of making it testable does not worth it. Does it help? |
|
We should definitely consider more complicated troubleshooting to be a regression. That said, I agree with you that this code is virtually impossible to test without a change to Dart to allow privates to be tested. Hopefully one day we'll have that, but that day is not today. test-exempt: testing this requires a change to Dart or a change to the API; changing the API is not desired for this code. |
goderbauer
left a comment
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
Manual roll requested by tarrinneal@google.com flutter/flutter@3bb2e59...1ca8873 2024-03-12 godofredoc@google.com Update integration tests regexes. (flutter/flutter#144847) 2024-03-11 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fail tests on exceptions raised after test completed (#144706)" (flutter/flutter#144970) 2024-03-11 polinach@google.com Make TabController communicating creation in constructor. (flutter/flutter#144912) 2024-03-11 goderbauer@google.com Fail tests on exceptions raised after test completed (flutter/flutter#144706) 2024-03-11 nate.w5687@gmail.com Refactoring `if` chains into `switch` statements (flutter/flutter#144905) 2024-03-11 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Expose build mode in environment of asset transformer processes (#144752)" (flutter/flutter#144957) 2024-03-11 andrewrkolos@gmail.com Expose build mode in environment of asset transformer processes (flutter/flutter#144752) 2024-03-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9196947bc687 to 6745955bb49e (2 revisions) (flutter/flutter#144946) 2024-03-11 vtrgalo@gmail.com Skip test temporarily until headingLevel is added in engine (issue 41� (flutter/flutter#135077) 2024-03-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from 3b0b59bb224d to 9196947bc687 (1 revision) (flutter/flutter#144934) 2024-03-11 engine-flutter-autoroll@skia.org Roll Packages from 0badb43 to d489d84 (3 revisions) (flutter/flutter#144931) 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 Please CC rmistry@google.com,stuartmorgan@google.com,tarrinneal@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: 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
Contributes to #144910