-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!: property decode new
oneof
cases (#255)
We have proto definitions that use `oneof`, like this: ```protobuf message Foo { oneof something { string bar = 1; string baz = 2; } } ``` We also have decoding that does something like this: ```javascript switch (foo.something?.$case) { case 'bar': // ...do something... case 'baz': // ...do something... default: throw new Error('Unexpected case') } ``` This will break if we add another case, like this: ```diff message Foo { oneof something { string bar = 1; string baz = 2; + string qux = 3; } } ``` This fixes those cases in the codebase, treating an unknown `oneof` as skipped. We already did this in a few places. I manually tested this (by adding a new oneof case) to make sure things would still decode correctly if an old version decoded something from a new version.
- Loading branch information
Showing
1 changed file
with
29 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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