diff --git a/pkgs/gcloud/CHANGELOG.md b/pkgs/gcloud/CHANGELOG.md index bb604150..a0466bf8 100644 --- a/pkgs/gcloud/CHANGELOG.md +++ b/pkgs/gcloud/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.8.11 +- After the first `Page` created by `Datastore.withRetry()` retries were not + happening. This is now fixed, ensuring that `Page.next()` will always retry + when `Datastore` is wrapped with `Datastore.withRetry()`. +- Calling with `wait: false` in `Subscription.pull(wait: false)` for `PubSub` + have been deprecated. + ## 0.8.10 - Widen the SDK constraint to support Dart 3.0 diff --git a/pkgs/gcloud/lib/src/pubsub_impl.dart b/pkgs/gcloud/lib/src/pubsub_impl.dart index ce491b18..cfdb3aca 100644 --- a/pkgs/gcloud/lib/src/pubsub_impl.dart +++ b/pkgs/gcloud/lib/src/pubsub_impl.dart @@ -97,6 +97,7 @@ class _PubSubImpl implements PubSub { String subscription, bool returnImmediately) { var request = pubsub.PullRequest() ..maxMessages = 1 + // ignore: deprecated_member_use ..returnImmediately = returnImmediately; return _api.projects.subscriptions.pull(request, subscription); } @@ -428,7 +429,10 @@ class _SubscriptionImpl implements Subscription { Future delete() => _api._deleteSubscription(_subscription.name!); @override - Future pull({bool wait = true}) { + Future pull({ + @Deprecated('returnImmediately has been deprecated from pubsub') + bool wait = true, + }) { return _api._pull(_subscription.name!, !wait).then((response) { // The documentation says 'Returns an empty list if there are no // messages available in the backlog'. However the receivedMessages diff --git a/pkgs/gcloud/lib/src/retry_datastore_impl.dart b/pkgs/gcloud/lib/src/retry_datastore_impl.dart index e57410cf..72b75277 100644 --- a/pkgs/gcloud/lib/src/retry_datastore_impl.dart +++ b/pkgs/gcloud/lib/src/retry_datastore_impl.dart @@ -135,7 +135,7 @@ class _RetryPage implements Page { @override Future> next({int? pageSize}) async { - return await _retryOptions.retry( + final nextPage = await _retryOptions.retry( () async { if (pageSize == null) { return await _delegate.next(); @@ -145,6 +145,7 @@ class _RetryPage implements Page { }, retryIf: _retryIf, ); + return _RetryPage(nextPage, _retryOptions); } } diff --git a/pkgs/gcloud/pubspec.yaml b/pkgs/gcloud/pubspec.yaml index 7a58f69e..aa121930 100644 --- a/pkgs/gcloud/pubspec.yaml +++ b/pkgs/gcloud/pubspec.yaml @@ -1,5 +1,5 @@ name: gcloud -version: 0.8.10 +version: 0.8.11 description: >- High level idiomatic Dart API for Google Cloud Storage, Pub-Sub and Datastore. repository: https://github.com/dart-lang/gcloud