Repository navigation
Improve handling of slow Flutter daemon responses - #6055
Conversation
There was a problem hiding this comment.
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.
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
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
b37aca1 to
dca9070
Compare
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