Repository navigation
feat(dart): support per-call retry - #7787
Merged
Merged
Conversation
Adds a configurable retry parameter to service methods, e.g.,
```dart
await someService.someMethod(
SomeRequest(),
retry: const ExponentialRetry.onCodes(
[Code.unavailable, Code.resourceExhausted],
initialDelay: Duration(milliseconds: 10),
),
);
```
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds support for custom retry behavior in Dart generated services by introducing an optional RetryRunner? retry parameter to service methods, fake methods, and templates. Feedback highlights two main issues: first, the retry parameter in fake_method.gotmpl is not forwarded to the underlying callbacks, preventing custom retry verification in tests; second, there is a discrepancy in method.gotmpl where the documentation states a default retry policy will be used, but the code explicitly defaults to noRetry.
natebosch
approved these changes
Oct 28, 2026
zhumin8
pushed a commit
that referenced
this pull request
Nov 3, 2026
🤖 I have created a release *beep* *boop* --- ## [0.51.0](v0.50.0...v0.51.0) (2026-10-31) ### Features * **dart:** support per-call retry ([#7787](#7787)) ([24344b6](24344b6)) * **sidekick/rust:** convert proto2 optionals ([#7867](#7867)) ([c9629b6](c9629b6)) * **sidekick:** mark `proto2` optional fields ([#7865](#7865)) ([b91651f](b91651f)) ### Bug Fixes * **dart:** do not delete CHANGELOG.md ([#7817](#7817)) ([4f027cb](4f027cb)) * **dart:** restore package description position ([#7370](#7370)) ([bac42b7](bac42b7)) * **internal/librarian/dart:** set initial `librarian.yaml` version on `bump` ([#7808](#7808)) ([9f9042e](9f9042e)) * **internal/serviceconfig:** add title for shopping merchant reviews v1 ([#7805](#7805)) ([bf53ece](bf53ece)) * **internal/serviceconfig:** add title for shopping merchant reviews v1 ([#7805](#7805)) ([affbeb4](affbeb4)) * **sidekick/swift:** use fast WKTAny helpers ([#7826](#7826)) ([b6c93c5](b6c93c5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a configurable retry parameter to service methods, e.g.,
The generated method looks like:
The reason why the
retryis nullable is to make it possible to add service-level retry configuration.