grpc / grpc/grpc-web

Introducing new Enum value doesn't result in default value in client

Open
#1,262 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.3k
Forks
802
Avg merge
1d 7h
Merged PRs (30d)
5

Description

We have a client generated using protoc with the Typescript option included and are then making requests using grpc-web.

We recently introduced a new value to an enum, and as we are following the proto guidelines of have a default value assigned to 0 for the first value of the enum, we expected the the client to default to this value until it was updated and made aware of the new enum value.

This does not seem to have happened, instead the int value of the enum is present.

Is there a setting that can be applied so that the default enum value is used in the situation the client is unaware of the enum value?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the behavior with a protoc-generated TypeScript client and grpc-web after adding an enum value that the client does not know about. Check how the generated client represents that value and whether an existing setting or test covers unknown enums; done means the default enum value is used, or the limitation is documented clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, typescript
Domain
api, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.