yikuang / wave-protocol

Automatically exported from code.google.com/p/wave-protocol
0 stars 0 forks source link

enums are bad in protobufs #29

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We currently use enums for HashAltgorithm and SignatureAlgorithm in the 
protobufs. Should we ever add a new value to the enum, and send a signature 
to a server that runs old code, the hash_algorithm field will be treated as 
not being there. But since it's marked required, badness will ensue. 

We probably either want to switch away from enums, or make the algorithm 
fields options, or something like that.

Original issue reported on code.google.com by dirk.bal...@gmail.com on 24 Jul 2009 at 5:55

GoogleCodeExporter commented 9 years ago
Is the best solution to switch to just using an integer, and defining the list 
of 
integer<->name mappings in the spec? 

Original comment by anthonybaxter@gmail.com on 16 Mar 2010 at 4:19

GoogleCodeExporter commented 9 years ago
That would be one way. Another would be to just use strings, and mention those 
in the 
spec.

Original comment by dirk.bal...@gmail.com on 16 Mar 2010 at 5:03