From 6fdc1e9b18bd168d997f6b2777bd28f2b3b00c25 Mon Sep 17 00:00:00 2001 From: Michel Feinstein Date: Wed, 31 Jul 2019 22:30:34 -0300 Subject: [PATCH 1/2] [google_sign_in] Fixes PlataformException leaking in debug mode (#37343) --- packages/google_sign_in/CHANGELOG.md | 6 +++++- packages/google_sign_in/lib/google_sign_in.dart | 8 ++++++-- packages/google_sign_in/pubspec.yaml | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/google_sign_in/CHANGELOG.md b/packages/google_sign_in/CHANGELOG.md index 8dcaa3a61f55..56fa7ffbf648 100644 --- a/packages/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.5+1 + +* Fixed the `PlatformException` leaking from `catchError()` in debug mode. + ## 4.0.5 * Update README with solution to `APIException` errors. @@ -6,7 +10,7 @@ * Revert changes in 4.0.3. -## 4.0.3 +## 4.0.3 * Update guava to `27.0.1-android`. * Add correct @NonNull annotations to reduce compiler warnings. diff --git a/packages/google_sign_in/lib/google_sign_in.dart b/packages/google_sign_in/lib/google_sign_in.dart index 740188fd8767..ca6e6bbaf705 100755 --- a/packages/google_sign_in/lib/google_sign_in.dart +++ b/packages/google_sign_in/lib/google_sign_in.dart @@ -342,9 +342,13 @@ class _MethodCompleter { final Completer _completer = Completer(); - void complete(FutureOr value) { + Future complete(FutureOr value) async { if (value is Future) { - value.then(_completer.complete, onError: _completer.completeError); + try { + _completer.complete(await value); + } catch (e, stacktrace) { + _completer.completeError(e, stacktrace); + } } else { _completer.complete(value); } diff --git a/packages/google_sign_in/pubspec.yaml b/packages/google_sign_in/pubspec.yaml index d337bd1fc9e9..8759959082aa 100755 --- a/packages/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android and iOS. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/google_sign_in -version: 4.0.5 +version: 4.0.5+1 flutter: plugin: From ffc4cda0ca44f0ae99ebce960971fb1fb781af35 Mon Sep 17 00:00:00 2001 From: Michel Feinstein Date: Thu, 1 Aug 2019 13:38:28 -0300 Subject: [PATCH 2/2] [google_sign_in] Fixes the version number. --- packages/google_sign_in/CHANGELOG.md | 2 +- packages/google_sign_in/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google_sign_in/CHANGELOG.md b/packages/google_sign_in/CHANGELOG.md index 56fa7ffbf648..13aafeea58af 100644 --- a/packages/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/CHANGELOG.md @@ -1,4 +1,4 @@ -## 4.0.5+1 +## 4.0.6 * Fixed the `PlatformException` leaking from `catchError()` in debug mode. diff --git a/packages/google_sign_in/pubspec.yaml b/packages/google_sign_in/pubspec.yaml index 8759959082aa..ee5ad7e3f861 100755 --- a/packages/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android and iOS. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/google_sign_in -version: 4.0.5+1 +version: 4.0.6 flutter: plugin: