Skip to content

Recreate tracing controller on reconnect. #5071

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 8 commits into from
Jan 20, 2023

Conversation

polina-c
Copy link
Contributor

@polina-c polina-c commented Jan 19, 2023

RELEASE_NOTE_EXCEPTION=[already covered in https://github.com//pull/4614]

Follow up for #5062 (comment)

@polina-c polina-c changed the title Update memory_controller.dart Recreate tracing controller on reconnect. Jan 19, 2023
@polina-c polina-c marked this pull request as ready for review January 19, 2023 14:35
@polina-c polina-c requested a review from bkonyi as a code owner January 19, 2023 14:35
@polina-c polina-c requested a review from a team as a code owner January 19, 2023 16:21
Comment on lines 308 to 309
tracingPaneController.dispose();
tracingPaneController = TracingPaneController();
Copy link
Member

Choose a reason for hiding this comment

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

why does this controller need to be recreated and the other two (profilePaneController and diffPaneController) do not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good question that triggered nice refactoring. Thank you!

@@ -40,6 +40,34 @@ class OfflineFileException implements Exception {
String toString() => message;
}

class MemoryChildControllers {
Copy link
Member

Choose a reason for hiding this comment

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

rename to MemoryFeatureControllers to match naming in other screens.

It would be worth investigating state management between the performance page and the memory page to see if we should use a common approach there. The Performance page and the Memory page have a similar setup where each tab contains a somewhat self contained feature. In the performance screen, we have a concept of "activeFeature" and each feature controller extends PerformanceFeatureController, which is an abstract class with lifecycle methods that each feature controller should implement (some examples init, onBecomingActive, setOfflineData, clearData, etc.). This setup is nice from an organization standpoint but also prevents us from doing business logic work in a controller that we don't need to be doing if a feature is not active. Not pressing to do in this PR, but just food for thought.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks

Noted this for the time I will work to support offline mode for memory screen.


final tracingPaneController = TracingPaneController();
/// Sub-controllers of memory controller.
late final MemoryChildControllers children;
Copy link
Member

Choose a reason for hiding this comment

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

nit: rename to featureControllers

Copy link
Contributor Author

@polina-c polina-c Jan 20, 2023

Choose a reason for hiding this comment

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

featureControllers is too long. how about just `controllers' ?

I want this expression to be easy to read and take reasonable space:

controller.controllers.diff

Copy link
Member

@kenzieschmoll kenzieschmoll left a comment

Choose a reason for hiding this comment

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

two naming requests, then lgtm

@polina-c polina-c merged commit 73d0ad2 into flutter:master Jan 20, 2023
@polina-c polina-c deleted the tracing-state branch January 20, 2023 14:48
@CoderDake CoderDake mentioned this pull request Jan 24, 2023
7 tasks
@DartDevtoolWorkflowBot DartDevtoolWorkflowBot mentioned this pull request Jan 24, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants