Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/flutter/flutter.git. Pull mirroring updated .
  1. Apr 12, 2025
  2. Apr 11, 2025
    • flutteractionsbot's avatar
      [CP-stable][ Hot Restart ] Fix possible hang due to unhandled exception in UI... · cf56914b
      flutteractionsbot authored
      [CP-stable][ Hot Restart ] Fix possible hang due to unhandled exception in UI isolates on hot restart (#166064)
      
      This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request)
      Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.
      
      ### Issue Link:
      
      https://github.com/flutter/flutter/issues/161466
      
      ### Changelog Description:
      
      [flutter/161466](https://github.com/flutter/flutter/issues/161466): Fixed issue where hot restart could hang indefinitely if "Pause on Unhandled Exceptions" was enabled and a call to `Isolate.run` had not completed.
      
      ### Impact Description:
      
      Hot restart (and the Dart-Code extension) could end up in a bad state where hot restart never completes and interacting with the application via the Dart-Code extension doesn't work as expected. The application becomes unresponsive and must be fully restarted to continue development.
      
      `Isolate.run` is used to load license files in the background, meaning that users don't need to explicitly be spawning isolates to encounter this issue.
      
      ### Workaround:
      Is there a workaround for this issue?
      
      Explicitly disable "Pause on Unhandled Exceptions", which is typically enabled by default.
      
      ### Risk:
      What is the risk level of this cherry-pick?
      
      ### Test Coverage:
      Are you confident that your fix is well-tested by automated tests?
      
      ### Validation Steps:
      What are the steps to validate that this fix works?
      
      1. Create a Flutter project with the following `main.dart`:
      
      ```dart
      
        import 'dart:async';
        import 'dart:developer';
        import 'dart:isolate';
      
        import 'package:flutter/material.dart';
      
        void main() {
          WidgetsFlutterBinding.ensureInitialized().platformDispatcher.onError = (Object error, StackTrace? stack) {
            return true;
          };
          runApp(
            const Center(
              child: Text(
                'Hello, world!',
                key: Key('title'),
                textDirection: TextDirection.ltr,
              ),
            ),
          );
      
          Isolate.run(() {
            print('COMPUTING');
            debugger();
          });
        }
      ```
      
      2. Run the application in debug mode and perform a hot restart once `COMPUTING` appears on `stdout`. Hot restart should complete successfully.
      cf56914b
  3. Apr 10, 2025
  4. Apr 09, 2025
  5. Mar 28, 2025
  6. Mar 14, 2025
  7. Mar 13, 2025
  8. Mar 12, 2025
  9. Mar 11, 2025
  10. Mar 08, 2025
  11. Mar 01, 2025
  12. Feb 28, 2025
  13. Feb 27, 2025
  14. Feb 26, 2025
  15. Feb 21, 2025
  16. Feb 20, 2025