Warn before Flutter upgrade on Windows - #9092
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a warning dialog for Windows users when attempting to upgrade Flutter from within the IDE, as the Dart SDK may be locked by active IDE processes. The review feedback highlights two issues: first, the overridden actionPerformed method in FlutterUpgradeAction needs to report analytics before returning early on Windows to comply with the repository style guide; second, the double single quotes in the newly added properties message should be replaced with single quotes, as the message does not contain format parameters and would otherwise render literally.
| widget.preview.choose_pubroot.title=Select Flutter Project | ||
| widget.preview.choose_pubroot.description=Select the Flutter project to use for Flutter Widget Preview. | ||
| flutter.upgrade.windows.title=Flutter Upgrade on Windows | ||
| flutter.upgrade.windows.message=Flutter upgrades can fail on Windows while the IDE is running because the Dart SDK may be locked by IDE processes. Close the IDE and run ''flutter upgrade'' from a terminal instead. |
There was a problem hiding this comment.
[CONCERN] In IntelliJ properties files, single quotes should only be doubled (''...) if the message contains format parameters (like {0}). Since this message does not contain any parameters, the double single quotes will be rendered literally as double single quotes in the UI. Use single quotes instead.
flutter.upgrade.windows.message=Flutter upgrades can fail on Windows while the IDE is running because the Dart SDK may be locked by IDE processes. Close the IDE and run 'flutter upgrade' from a terminal instead.
|
Does this upgrade command always fail on windows? (I am trying to understand if this change is likely to raise complaints from others who are using the upgrade successfully) The associated issue also mentions that other SDK commands also fail. Are you able to reproduce that as well? If so, we may want this suggestion within the superclass instead of overriding just for upgrade. |
|
Thanks for the clarification. I haven't been able to reproduce the Windows-specific failure locally, since my development environment is Linux, so I can't confirm that My change was based on the issue reports describing Dart SDK files being locked while the IDE is running. Given your concern, I agree that blocking I can revise the approach once we determine whether this is specific to upgrade or applies to SDK commands more generally. If the same locking condition affects multiple commands, handling it in the superclass sounds more appropriate. |
Addresses #7668.
On Windows, running
flutter upgradefrom inside the IDE can fail because Dart SDK files may still be locked by IDE processes.This change prevents the upgrade action from starting on Windows and instead shows a message instructing users to close the IDE and run
flutter upgradefrom a terminal.Linux and macOS behavior is unchanged.
Testing
./gradlew compileJava./gradlew test --tests 'io.flutter.actions.*'Both completed successfully.
The Windows-specific runtime behavior was not tested locally.