Skip to content

Wait for the Dart plugin to start the DevTools server with retries #8177

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 12 commits into from
May 9, 2025

Conversation

elliette
Copy link
Member

@elliette elliette commented May 9, 2025

Fixes #8144

This PR:

  • Makes sure we only ever have one connected DevTools server
  • Tracks the start-up of the DevTools server using the Progress API instead of executeOnPooledThread (logic pulled into DevToolsServerTask.java). This allows us to display the progress and cancel the server startup on forceRestart.
  • Retries waiting for the Dart plugin initiated DevTools server until a timeout is reached
  • If the Dart plugin DevTools is not ready by the timeout, switching to a new Flutter panel will re-trigger starting the server

Server start-up status:

Screenshot 2025-05-09 at 12 40 31 PM

Message if waiting for the server timed out:

Screenshot 2025-05-09 at 1 26 55 PM

Loaded Property Editor:

Screenshot 2025-05-09 at 12 39 37 PM

@elliette elliette marked this pull request as ready for review May 9, 2025 20:29
@elliette elliette requested review from jwren, pq and helin24 May 9, 2025 20:29
Copy link
Contributor

@pq pq left a comment

Choose a reason for hiding this comment

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

Just some nits really. This looks great. Looking forward to testing it out! 🎉

Copy link
Member

@helin24 helin24 left a comment

Choose a reason for hiding this comment

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

thanks! looks great!

AsyncUtils.whenCompleteUiThread(
DevToolsService.getInstance(project).getDevToolsInstance(),
(instance, error) -> {
viewUtils.presentLabel(toolWindow, "Loading " + getToolWindowTitle() + "...");

// Skip displaying if the project has been closed.
Copy link
Member

Choose a reason for hiding this comment

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

rewrite this comment

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops autosubmit beat me to it! I will open a follow up PR monday

@auto-submit auto-submit bot merged commit 7037972 into flutter:master May 9, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite spinner while trying to load property editor
4 participants