Skip to content

Improve handling of slow Flutter daemon responses - #6055

Merged
DanTup merged 1 commit into
masterfrom
improve-timeout-handling
May 14, 2026
Merged

DanTup merged 1 commit into
masterfrom
improve-timeout-handling

Conversation

@DanTup

@DanTup DanTup commented May 14, 2026

Copy link
Copy Markdown
Member

Previously after 20s we consider the daemon unresponsive and show a notification (and record an event). However, logs have been provided showing 40s responses if VS Code is opened at the same time as many other applications immediately after booting a MacBook.

This change keeps the 20s timeout and returns a default response, but only shows the notification/records an event if there is no response for 2 minutes.

This should avoid false alerts without potentially delaying anything where we've blocked the UI waiting on a response for a long period.

Fixes #6048

@DanTup DanTup added this to the v3.136.0 milestone May 14, 2026
@DanTup DanTup added is enhancement An enhancement or improvement that should be listed in release notes but is not a bug fix. in flutter Relates to running Flutter apps labels May 14, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the Flutter daemon's timeout logic by introducing a dual-timeout mechanism: a 20-second caller timeout that returns a default value and a 2-minute hang timeout for error logging and reload prompts. The getEmulators and getSupportedPlatforms methods were updated to utilize this new structure. Review feedback identified a typo in a log message and recommended explicitly clearing the caller timeout timer upon promise resolution or rejection to improve resource management.

Comment thread src/extension/flutter/flutter_daemon.ts Outdated
Comment thread src/extension/flutter/flutter_daemon.ts Outdated

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@codecov

codecov Bot commented May 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.42105% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.56%. Comparing base (468cbc6) to head (dca9070).

Files with missing lines Patch % Lines
src/extension/flutter/flutter_daemon.ts 66.66% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6055      +/-   ##
==========================================
+ Coverage   70.54%   70.56%   +0.01%     
==========================================
  Files         171      171              
  Lines       12971    12975       +4     
  Branches     2589     2589              
==========================================
+ Hits         9151     9156       +5     
+ Misses       3335     3333       -2     
- Partials      485      486       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/extension/flutter/flutter_daemon.ts
Comment thread src/extension/flutter/flutter_daemon.ts Outdated
Comment thread src/extension/flutter/flutter_daemon.ts
Previously after 20s we consider the daemon unresponsive and show a notification (and record an event). However, logs have been provided showing 40s responses if VS Code is opened at the same time as many other applications immediately after booting a MacBook.

This change keeps the 20s timeout and returns a default response, but only shows the notification/records an event if there is no response for 2 minutes.

This should avoid false alerts without potentially delaying anything where we've blocked the UI waiting on a response for a long period.

Fixes #6048
@DanTup
DanTup force-pushed the improve-timeout-handling branch from b37aca1 to dca9070 Compare May 14, 2026 10:16
@DanTup
DanTup merged commit 7c6d639 into master May 14, 2026
24 of 25 checks passed
@DanTup
DanTup deleted the improve-timeout-handling branch May 14, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in flutter Relates to running Flutter apps is enhancement An enhancement or improvement that should be listed in release notes but is not a bug fix.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tweak the timeouts for considering the Flutter daemon as unresponsive

1 participant