google / google/protobuf.dart

protobuf stubs don't discriminate between unary and streaming requests

Open
#465 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
572
Forks
196
Avg merge
1h 59m
Merged PRs (30d)
2

Description

These different methods:
```protobuf
service Mu {
rpc Search (SearchRequest) returns (SearchResponse);
rpc StreamingSearch (stream SearchRequest) returns (stream SearchResponse);
}
```

generate into the same code in the stub:
```dart
$async.Future search($pb.ClientContext ctx, SearchRequest request) {
var emptyResponse = SearchResponse();
return _client.invoke(ctx, 'SearchService', 'Search', request, emptyResponse);
}
$async.Future streamingSearch($pb.ClientContext ctx, SearchRequest request) {
var emptyResponse = SearchResponse();
return _client.invoke(ctx, 'SearchService', 'StreamingSearch', request, emptyResponse);
}
```

This is incorrect, because unary and streaming requests aren't interchangeable, and the streaming request in particular can't yield multiple values or receive multiple values

Contributor guide

Open the contributing guide

Research direction

No file, test, or entry point is identified in the issue. Locate the Dart protobuf stub-generation entry point and inspect how unary versus streaming RPCs are represented; done means the generated APIs distinguish both request types and support streaming values correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
backend-api-design, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.