microavia / messgen

MIT License
9 stars 11 forks source link

JS messgen parser fails silently with improperly ordered complex message IDs #67

Open Roman- opened 1 year ago

Roman- commented 1 year ago

In JS messgen parser, if the messages listed in a way that the ID of a complex message is less than the ID of one of its internal messages, the parser does not work and does not fire any error. Example:

bottle.yaml:

id: 67
fields:
  - { name: name,   type: string }
  - { name: liquid, type: liquid }

liquid.yaml:

id: 68
descr: "I am inside the bottle"
fields:
  - { name: density,      type: uint64 }
  - { name: is_coca_cola, type: uint8 }

Messgen would generate JS files without any warnings and successfully parse every message. However, when message "bottle" is received, it will have the following properties:

offset: NaN isComplex: false (which is wrong)

meded90 commented 1 year ago

36 same error