Skip to content
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

Keep mapping of thread ids to thread names up to date #3603

Merged
merged 2 commits into from
Feb 17, 2022

Conversation

blaugold
Copy link
Contributor

@blaugold blaugold commented Jan 28, 2022

This change updates the map of known threads each time new
timeline data is loaded.

The timeline lanes of threads that did not exist when the first batch of
timeline data was loaded were previously labeled Unknown. Now
they have the same labeling as other threads.

Fixes #1881

if (name.contains('.ui')) {
uiThreadId = event.threadId;
}
if (isInitialUpdate) {
Copy link
Member

Choose a reason for hiding this comment

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

we should also check if we are connected to a flutter app (either offline or online). See an example of the below check here:

if (isOfflineFlutterApp ||
(!offlineController.offlineMode.value &&
serviceManager.connectedApp.isFlutterAppNow))

final isOfflineFlutterApp = offlineController.offlineMode.value &&
       offlinePerformanceData != null &&
        offlinePerformanceData.frames.isNotEmpty;

if (isInitialUpdate && (isOfflineFlutterApp ||
            (!offlineController.offlineMode.value &&
                serviceManager.connectedApp.isFlutterAppNow))

Copy link
Member

Choose a reason for hiding this comment

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

Store this condition in a variable and use it everywhere that isInitialUpdate is used currently

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@kenzieschmoll
Copy link
Member

Also, make sure you clear threadNamesById in clearData()

@blaugold
Copy link
Contributor Author

Thanks for reviewing this PR.

This change updates the map of known threads each time new
timeline data is loaded.

The timeline lanes of isolates that did not exist when the first batch of
timeline data was loaded were previously labeled `Unknown`. Now
they have the same labeling as other isolates.

Fixes flutter#1881
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.

Unknown thread shows up in timeline
2 participants