protocolbuffers / protocolbuffers/protobuf-javascript
JavaScript: repeated enum AssertionError when deserializingBinary
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 471
- フォーク
- 91
- 平均マージ
- 3時間 57分
- マージ済み PR(30日)
- 2
説明
What version of protobuf and what language are you using?
Version: v3.6.1
Language: Javascript with Typescript
What operating system (Linux, Windows, ...) and version?
Windows 10 x64
What runtime / compiler are you using (e.g., python version or gcc version)
im using tsc (Typescript compiler)
In order to generate the .ts files from the .proto im using the command protoc --plugin option with the protoc-gen-ts plugin
What did you do?
Steps to reproduce the behavior:
- create a protobuf file that contains a repeated enum message
- Send a Protobuf binary from my Android App to my Nodejs Express Server
- Attempt to deserialize the buffer in my Express Server
What did you expect to see
a Protobuf Object
What did you see instead?
AssertionError on the repeated enum field.
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
my custom repeated enum field is repeated Amenities amenities = 22; and another one at =23;
my protobuff buffer base64 encoded:
ChoyMDE4LTEwLTA2VDIwOjM5OjI0LjI2NDAyORDcCxgCIAEq8gEKA0dhbBIIU2h0ZW5nZWwangFodHRwczovL3Njb250ZW50LmZzZHYzLTEuZm5hLmZiY2RuLm5ldC92L3QzMS4wLTgvMjYyMjEwMTZfMjA5NzUwMzIwNjk0NTg0Nl82NDE3NzA1NTMyMzI5NDYzMDcyX28uanBnP19uY19jYXQ9MCZvaD1iMjE4Y2ZiNDE2MTFlMWY4YTJjZDA0ODM1MzZjZGI0OCZvZT01QzA5MEFCNCAYggE9SGkgaW0gR2FsLCAyNCBsaWtlcyBhIGxvdCBvZiBzdHVmZiBsaWtlIEZsdXV0dGVyIGFuZCBNb3JlZWVlLjIkMDg3ZWQwM2EtMzJmMS00ZDljLWE1YWEtODQ5Y2U3NDliNWQ1QkkKFteq15wg15DXkdeZ15EgLSDXmdek15USGdep15PXqNeV16og16jXldeY16nXmdec15MaAjU2MVbozfKGCEBAOTaVoBqKY0FAUANYAYIBGjIwMTgtMTAtMDZUMjA6Mzk6MjQuMjY0MjMziAEykAEBmAEEoAEAqgElIEdvb2QgbmV3IGFwYXJ0bWVudCB0byBqb2luIHRvbyAhISEgIbABA7ABArgBAbgBArgBAMABEsgBJNABAA==
my error:
[TypeScript] AssertionError: Assertion failed
[TypeScript] at new goog.asserts.AssertionError (C:\Users\Gal\Desktop\roommiesusersmicroservice\node_modules\google-protobuf\google-protobuf.js:98:603)
[TypeScript] at Object.goog.asserts.doAssertFailure_ (C:\Users\Gal\Desktop\roommiesusersmicroservice\node_modules\google-protobuf\google-protobuf.js:99:126)
[TypeScript] at Object.goog.asserts.assert (C:\Users\Gal\Desktop\roommiesusersmicroservice\node_modules\google-protobuf\google-protobuf.js:99:385)
[TypeScript] at jspb.BinaryReader.readPackedField_ (C:\Users\Gal\Desktop\roommiesusersmicroservice\node_modules\google-protobuf\google-protobuf.js:359:71)
[TypeScript] at jspb.BinaryReader.readPackedEnum (C:\Users\Gal\Desktop\roommiesusersmicroservice\node_modules\google-protobuf\google-protobuf.js:364:287)
[TypeScript] at Function.proto.ProtobufApartment.deserializeBinaryFromReader (C:\Users\Gal\Desktop\roommiesusersmicroservice\dist\protobuf\generated\apartment_pb.js:210:67)
[TypeScript] at Function.proto.ProtobufApartment.deserializeBinary (C:\Users\Gal\Desktop\roommiesusersmicroservice\dist\protobuf\generated\apartment_pb.js:116:34)
Anything else we should know about your project / environment
It crashes when it tries to read my repeated enum field.
please help me..
thanks!
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、google-protobuf.js の repeated enum の再現とスタックトレースを確認します。特に BinaryReader.readPackedField_ と readPackedEnum を確認してください。生成された dist/protobuf/generated/apartment_pb.js のデシリアライザを調査し、repeated enum フィールドを含む提供されたバイナリをテストします。バッファが AssertionError なしで Protobuf オブジェクトにデシリアライズできれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- express, javascript, nodejs, typescript
- 領域
- api, backend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100