JavaScript: repeated enum AssertionError when deserializingBinary
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- express, javascript, nodejs, typescript
Piste de recherche
Commencez par reproduire le problème des enums répétés et examiner la trace de la pile dans google-protobuf.js, en particulier BinaryReader.readPackedField_ et readPackedEnum. Inspectez le désérialiseur généré dans dist/protobuf/generated/apartment_pb.js et testez le binaire fourni avec des champs enum répétés. C’est terminé lorsque le buffer est désérialisé en un objet Protobuf sans l’AssertionError.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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!
- Langage dominant
- JavaScript
- Étoiles
- 471
- Forks
- 91
- Merge moyen
- 1 j 12 h
- PR mergées (30 j)
- 6
Préparer son environnement
Nous n'avons pas encore vérifié les fichiers d'installation de ce projet. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de protocolbuffers/protobuf-javascript
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 30/100
protocolbuffers/protobuf-javascript#248 · 1 commentaire · 13 réactions ·
-
question
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
protocolbuffers/protobuf-javascript#222 · 9 commentaires ·
-
Why map.js sort keys?Ouverteenhancement port-fix triaged
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
protocolbuffers/protobuf-javascript#185 · 1 commentaire ·
-
enhancement port-fix triaged
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
protocolbuffers/protobuf-javascript#182 · 3 commentaires · 1 réaction ·
Toutes les issues de protocolbuffers/protobuf-javascript
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
Les mainteneurs répondent en général sous 1 jour
-
curriculum documentation quality
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
githubnext/gh-aw-workshop#3897 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Les mainteneurs répondent en général sous 1 jour
-
agent/quality hive/hosted-available-lke648397-260827-5n31 quality testing
Difficulté 2/5 1-3 heures Accessibilité débutants 91/100
Les mainteneurs répondent en général sous 1 jour