Can't handle optional nested submessages when parsing MCAP file
See original GitHub issueDescription
If I generate an MCAP log with a channel whose type has multiple layers of nested sub-messages (in this schema, MessageType.fetchers[0].channel.schema.root_table.name
is a potentially valid reference), but don’t specify one of the sub-fields, foxglove studio barfs complaining about an undefined reference.
In this, case we have the below logfile: foo.mcap.gz
Which just contains a single channel/schema and a single message on that channel. The schema for the channel is:
{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"fetchers":{"items":{"properties":{"channel":{"properties":{"destination_nodes":{"items":{"properties":{"name":{"type":"string"},"priority":{"type":"number"},"time_to_live":{"type":"number"},"timestamp_logger":{"type":"number"},"timestamp_logger_nodes":{"items":{"type":"string"},"type":"array"}},"type":"object"},"type":"array"},"frequency":{"type":"number"},"logger":{"type":"number"},"logger_nodes":{"items":{"type":"string"},"type":"array"},"max_size":{"type":"number"},"name":{"type":"string"},"num_readers":{"type":"number"},"num_senders":{"type":"number"},"num_watchers":{"type":"number"},"read_method":{"type":"number"},"schema":{"properties":{"enums":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"documentation":{"items":{"type":"string"},"type":"array"},"is_union":{"type":"boolean"},"name":{"type":"string"},"underlying_type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"},"values":{"items":{"properties":{"documentation":{"items":{"type":"string"},"type":"array"},"name":{"type":"string"},"object":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"bytesize":{"type":"number"},"documentation":{"items":{"type":"string"},"type":"array"},"fields":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"default_integer":{"type":"number"},"default_real":{"type":"number"},"deprecated":{"type":"boolean"},"documentation":{"items":{"type":"string"},"type":"array"},"id":{"type":"number"},"key":{"type":"boolean"},"name":{"type":"string"},"offset":{"type":"number"},"optional":{"type":"boolean"},"required":{"type":"boolean"},"type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"is_struct":{"type":"boolean"},"minalign":{"type":"number"},"name":{"type":"string"}},"type":"object"},"union_type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"},"value":{"type":"number"}},"type":"object"},"type":"array"}},"type":"object"},"type":"array"},"file_ext":{"type":"string"},"file_ident":{"type":"string"},"objects":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"bytesize":{"type":"number"},"documentation":{"items":{"type":"string"},"type":"array"},"fields":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"default_integer":{"type":"number"},"default_real":{"type":"number"},"deprecated":{"type":"boolean"},"documentation":{"items":{"type":"string"},"type":"array"},"id":{"type":"number"},"key":{"type":"boolean"},"name":{"type":"string"},"offset":{"type":"number"},"optional":{"type":"boolean"},"required":{"type":"boolean"},"type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"is_struct":{"type":"boolean"},"minalign":{"type":"number"},"name":{"type":"string"}},"type":"object"},"type":"array"},"root_table":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"bytesize":{"type":"number"},"documentation":{"items":{"type":"string"},"type":"array"},"fields":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"default_integer":{"type":"number"},"default_real":{"type":"number"},"deprecated":{"type":"boolean"},"documentation":{"items":{"type":"string"},"type":"array"},"id":{"type":"number"},"key":{"type":"boolean"},"name":{"type":"string"},"offset":{"type":"number"},"optional":{"type":"boolean"},"required":{"type":"boolean"},"type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"is_struct":{"type":"boolean"},"minalign":{"type":"number"},"name":{"type":"string"}},"type":"object"},"services":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"calls":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"documentation":{"items":{"type":"string"},"type":"array"},"name":{"type":"string"},"request":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"bytesize":{"type":"number"},"documentation":{"items":{"type":"string"},"type":"array"},"fields":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"default_integer":{"type":"number"},"default_real":{"type":"number"},"deprecated":{"type":"boolean"},"documentation":{"items":{"type":"string"},"type":"array"},"id":{"type":"number"},"key":{"type":"boolean"},"name":{"type":"string"},"offset":{"type":"number"},"optional":{"type":"boolean"},"required":{"type":"boolean"},"type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"is_struct":{"type":"boolean"},"minalign":{"type":"number"},"name":{"type":"string"}},"type":"object"},"response":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"bytesize":{"type":"number"},"documentation":{"items":{"type":"string"},"type":"array"},"fields":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"default_integer":{"type":"number"},"default_real":{"type":"number"},"deprecated":{"type":"boolean"},"documentation":{"items":{"type":"string"},"type":"array"},"id":{"type":"number"},"key":{"type":"boolean"},"name":{"type":"string"},"offset":{"type":"number"},"optional":{"type":"boolean"},"required":{"type":"boolean"},"type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"is_struct":{"type":"boolean"},"minalign":{"type":"number"},"name":{"type":"string"}},"type":"object"}},"type":"object"},"type":"array"},"documentation":{"items":{"type":"string"},"type":"array"},"name":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"},"source_node":{"type":"string"},"type":{"type":"string"}},"type":"object"},"channel_index":{"type":"number"},"count":{"type":"number"},"latency":{"properties":{"average":{"type":"number"},"max":{"type":"number"},"min":{"type":"number"},"standard_deviation":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"name":{"type":"string"},"phased_loops":{"items":{"properties":{"count":{"type":"number"},"handler_time":{"properties":{"average":{"type":"number"},"max":{"type":"number"},"min":{"type":"number"},"standard_deviation":{"type":"number"}},"type":"object"},"name":{"type":"string"},"wakeup_latency":{"properties":{"average":{"type":"number"},"max":{"type":"number"},"min":{"type":"number"},"standard_deviation":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"pid":{"type":"number"},"send_failures":{"type":"number"},"senders":{"items":{"properties":{"channel":{"properties":{"destination_nodes":{"items":{"properties":{"name":{"type":"string"},"priority":{"type":"number"},"time_to_live":{"type":"number"},"timestamp_logger":{"type":"number"},"timestamp_logger_nodes":{"items":{"type":"string"},"type":"array"}},"type":"object"},"type":"array"},"frequency":{"type":"number"},"logger":{"type":"number"},"logger_nodes":{"items":{"type":"string"},"type":"array"},"max_size":{"type":"number"},"name":{"type":"string"},"num_readers":{"type":"number"},"num_senders":{"type":"number"},"num_watchers":{"type":"number"},"read_method":{"type":"number"},"schema":{"properties":{"enums":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"documentation":{"items":{"type":"string"},"type":"array"},"is_union":{"type":"boolean"},"name":{"type":"string"},"underlying_type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"},"values":{"items":{"properties":{"documentation":{"items":{"type":"string"},"type":"array"},"name":{"type":"string"},"object":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"bytesize":{"type":"number"},"documentation":{"items":{"type":"string"},"type":"array"},"fields":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"default_integer":{"type":"number"},"default_real":{"type":"number"},"deprecated":{"type":"boolean"},"documentation":{"items":{"type":"string"},"type":"array"},"id":{"type":"number"},"key":{"type":"boolean"},"name":{"type":"string"},"offset":{"type":"number"},"optional":{"type":"boolean"},"required":{"type":"boolean"},"type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"is_struct":{"type":"boolean"},"minalign":{"type":"number"},"name":{"type":"string"}},"type":"object"},"union_type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"},"value":{"type":"number"}},"type":"object"},"type":"array"}},"type":"object"},"type":"array"},"file_ext":{"type":"string"},"file_ident":{"type":"string"},"objects":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"bytesize":{"type":"number"},"documentation":{"items":{"type":"string"},"type":"array"},"fields":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"default_integer":{"type":"number"},"default_real":{"type":"number"},"deprecated":{"type":"boolean"},"documentation":{"items":{"type":"string"},"type":"array"},"id":{"type":"number"},"key":{"type":"boolean"},"name":{"type":"string"},"offset":{"type":"number"},"optional":{"type":"boolean"},"required":{"type":"boolean"},"type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"is_struct":{"type":"boolean"},"minalign":{"type":"number"},"name":{"type":"string"}},"type":"object"},"type":"array"},"root_table":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"bytesize":{"type":"number"},"documentation":{"items":{"type":"string"},"type":"array"},"fields":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"default_integer":{"type":"number"},"default_real":{"type":"number"},"deprecated":{"type":"boolean"},"documentation":{"items":{"type":"string"},"type":"array"},"id":{"type":"number"},"key":{"type":"boolean"},"name":{"type":"string"},"offset":{"type":"number"},"optional":{"type":"boolean"},"required":{"type":"boolean"},"type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"is_struct":{"type":"boolean"},"minalign":{"type":"number"},"name":{"type":"string"}},"type":"object"},"services":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"calls":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"documentation":{"items":{"type":"string"},"type":"array"},"name":{"type":"string"},"request":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"bytesize":{"type":"number"},"documentation":{"items":{"type":"string"},"type":"array"},"fields":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"default_integer":{"type":"number"},"default_real":{"type":"number"},"deprecated":{"type":"boolean"},"documentation":{"items":{"type":"string"},"type":"array"},"id":{"type":"number"},"key":{"type":"boolean"},"name":{"type":"string"},"offset":{"type":"number"},"optional":{"type":"boolean"},"required":{"type":"boolean"},"type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"is_struct":{"type":"boolean"},"minalign":{"type":"number"},"name":{"type":"string"}},"type":"object"},"response":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"bytesize":{"type":"number"},"documentation":{"items":{"type":"string"},"type":"array"},"fields":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"default_integer":{"type":"number"},"default_real":{"type":"number"},"deprecated":{"type":"boolean"},"documentation":{"items":{"type":"string"},"type":"array"},"id":{"type":"number"},"key":{"type":"boolean"},"name":{"type":"string"},"offset":{"type":"number"},"optional":{"type":"boolean"},"required":{"type":"boolean"},"type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"is_struct":{"type":"boolean"},"minalign":{"type":"number"},"name":{"type":"string"}},"type":"object"}},"type":"object"},"type":"array"},"documentation":{"items":{"type":"string"},"type":"array"},"name":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"},"source_node":{"type":"string"},"type":{"type":"string"}},"type":"object"},"channel_index":{"type":"number"},"count":{"type":"number"},"size":{"properties":{"average":{"type":"number"},"max":{"type":"number"},"min":{"type":"number"},"standard_deviation":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"timers":{"items":{"properties":{"count":{"type":"number"},"handler_time":{"properties":{"average":{"type":"number"},"max":{"type":"number"},"min":{"type":"number"},"standard_deviation":{"type":"number"}},"type":"object"},"name":{"type":"string"},"wakeup_latency":{"properties":{"average":{"type":"number"},"max":{"type":"number"},"min":{"type":"number"},"standard_deviation":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"watchers":{"items":{"properties":{"channel":{"properties":{"destination_nodes":{"items":{"properties":{"name":{"type":"string"},"priority":{"type":"number"},"time_to_live":{"type":"number"},"timestamp_logger":{"type":"number"},"timestamp_logger_nodes":{"items":{"type":"string"},"type":"array"}},"type":"object"},"type":"array"},"frequency":{"type":"number"},"logger":{"type":"number"},"logger_nodes":{"items":{"type":"string"},"type":"array"},"max_size":{"type":"number"},"name":{"type":"string"},"num_readers":{"type":"number"},"num_senders":{"type":"number"},"num_watchers":{"type":"number"},"read_method":{"type":"number"},"schema":{"properties":{"enums":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"documentation":{"items":{"type":"string"},"type":"array"},"is_union":{"type":"boolean"},"name":{"type":"string"},"underlying_type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"},"values":{"items":{"properties":{"documentation":{"items":{"type":"string"},"type":"array"},"name":{"type":"string"},"object":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"bytesize":{"type":"number"},"documentation":{"items":{"type":"string"},"type":"array"},"fields":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"default_integer":{"type":"number"},"default_real":{"type":"number"},"deprecated":{"type":"boolean"},"documentation":{"items":{"type":"string"},"type":"array"},"id":{"type":"number"},"key":{"type":"boolean"},"name":{"type":"string"},"offset":{"type":"number"},"optional":{"type":"boolean"},"required":{"type":"boolean"},"type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"is_struct":{"type":"boolean"},"minalign":{"type":"number"},"name":{"type":"string"}},"type":"object"},"union_type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"},"value":{"type":"number"}},"type":"object"},"type":"array"}},"type":"object"},"type":"array"},"file_ext":{"type":"string"},"file_ident":{"type":"string"},"objects":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"bytesize":{"type":"number"},"documentation":{"items":{"type":"string"},"type":"array"},"fields":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"default_integer":{"type":"number"},"default_real":{"type":"number"},"deprecated":{"type":"boolean"},"documentation":{"items":{"type":"string"},"type":"array"},"id":{"type":"number"},"key":{"type":"boolean"},"name":{"type":"string"},"offset":{"type":"number"},"optional":{"type":"boolean"},"required":{"type":"boolean"},"type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"is_struct":{"type":"boolean"},"minalign":{"type":"number"},"name":{"type":"string"}},"type":"object"},"type":"array"},"root_table":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"bytesize":{"type":"number"},"documentation":{"items":{"type":"string"},"type":"array"},"fields":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"default_integer":{"type":"number"},"default_real":{"type":"number"},"deprecated":{"type":"boolean"},"documentation":{"items":{"type":"string"},"type":"array"},"id":{"type":"number"},"key":{"type":"boolean"},"name":{"type":"string"},"offset":{"type":"number"},"optional":{"type":"boolean"},"required":{"type":"boolean"},"type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"is_struct":{"type":"boolean"},"minalign":{"type":"number"},"name":{"type":"string"}},"type":"object"},"services":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"calls":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"documentation":{"items":{"type":"string"},"type":"array"},"name":{"type":"string"},"request":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"bytesize":{"type":"number"},"documentation":{"items":{"type":"string"},"type":"array"},"fields":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"default_integer":{"type":"number"},"default_real":{"type":"number"},"deprecated":{"type":"boolean"},"documentation":{"items":{"type":"string"},"type":"array"},"id":{"type":"number"},"key":{"type":"boolean"},"name":{"type":"string"},"offset":{"type":"number"},"optional":{"type":"boolean"},"required":{"type":"boolean"},"type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"is_struct":{"type":"boolean"},"minalign":{"type":"number"},"name":{"type":"string"}},"type":"object"},"response":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"bytesize":{"type":"number"},"documentation":{"items":{"type":"string"},"type":"array"},"fields":{"items":{"properties":{"attributes":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object"},"type":"array"},"default_integer":{"type":"number"},"default_real":{"type":"number"},"deprecated":{"type":"boolean"},"documentation":{"items":{"type":"string"},"type":"array"},"id":{"type":"number"},"key":{"type":"boolean"},"name":{"type":"string"},"offset":{"type":"number"},"optional":{"type":"boolean"},"required":{"type":"boolean"},"type":{"properties":{"base_type":{"type":"number"},"element":{"type":"number"},"fixed_length":{"type":"number"},"index":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"},"is_struct":{"type":"boolean"},"minalign":{"type":"number"},"name":{"type":"string"}},"type":"object"}},"type":"object"},"type":"array"},"documentation":{"items":{"type":"string"},"type":"array"},"name":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"},"source_node":{"type":"string"},"type":{"type":"string"}},"type":"object"},"channel_index":{"type":"number"},"count":{"type":"number"},"handler_time":{"properties":{"average":{"type":"number"},"max":{"type":"number"},"min":{"type":"number"},"standard_deviation":{"type":"number"}},"type":"object"},"wakeup_latency":{"properties":{"average":{"type":"number"},"max":{"type":"number"},"min":{"type":"number"},"standard_deviation":{"type":"number"}},"type":"object"}},"type":"object"},"type":"array"}},"type":"object"}
The contents of the actual message are:
{"fetchers": [{"count": 123}], "pid": 12345}
Foxglove Studio pops up an error saying Error initializing player: Cannot read properties of undefined (reading 'schema')
(the schema
here is a reference to the schema
sub-object in my type–if I change the name in my type, it changes the name in the error message). It appears that foxglove attempts to read the fetchers[0].channel.schema
, but channel
is undefined. Interestingly, the logic appears to handle on a single layer of missing sub-messages (so if channels
were itself just a flat object with no sub-messages, then not populating it seems to work fine–I assume that https://github.com/foxglove/studio/blob/a20cf7ef51cae38d143a2d76e3e048c84c04a0d7/packages/mcap-support/src/parseJsonSchema.ts is somehow iterating over all the sub-types in a message when attempting to read things).
Also, empty JSON messages ({}
) don’t seem to be allowed, even if the schema permits it.
Expected Behavior
The logfile is successfully read and I can view the data that is populated.
Actual Behavior
I get an error and can’t view any data 😦
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top GitHub Comments
Awesome, thanks for all the references. Feel free to also provide any feedback on the https://github.com/foxglove/mcap repo or in our Slack group if you run into issues with the readers/writers or the spec. It’s still pretty new and we’re happy to have others trying it out!
If it does look like an AOS<->foxglove integration works well, I will probably try to get everything relevant open-sourced so that we have a clean visualization answer for both the FRC team and anyone else that may end up wanting to use AOS.