Skip to content

fix(pj_plugins): read manifest encoding as an array of strings#79

Closed
pabloinigoblasco wants to merge 1 commit intodevelopmentfrom
fix/plugin-catalog-encoding-array
Closed

fix(pj_plugins): read manifest encoding as an array of strings#79
pabloinigoblasco wants to merge 1 commit intodevelopmentfrom
fix/plugin-catalog-encoding-array

Conversation

@pabloinigoblasco
Copy link
Copy Markdown
Collaborator

Summary

Fix the embedded-manifest decoder so it reads encoding as an array of strings.

  • PluginDescriptor::encoding is now std::vector<std::string> (was a single std::string).
  • decodeManifest reads encoding via readStringArray and keeps the "non-empty for kMessageParser" requirement.
  • PluginRuntimeCatalog::loadAndRegisterMessageParser inserts every entry into loaded.encodings instead of pushing one string.
  • Mocks and parser guide doc updated to the array shape.
  • Unit test updated to compare against std::vector<std::string>.

Why

A previous refactor narrowed encoding to a single std::string and required it via requiredString(). Every bundled parser manifest (parser_json, parser_protobuf, parser_data_tamer, parser_ros) ships encoding as a JSON array, so every parser was rejected at scan time with plugin embedded manifest missing required string key: encoding and no parser-backed data source could load.

This restores the array shape so multi-encoding parsers (e.g. parser_ros advertising both ros1 and ros2) work as designed.

Testing

  • ctest --test-dir build -R plugin_catalog_test passes (assertion updated).
  • pj_proto_app loads csv, json, protobuf, mcap, parser_ros and the ROS 2 subscriber after this fix; before, all four parsers were ignored at boot.

Restore `PluginDescriptor::encoding` to `std::vector<std::string>` so the
embedded-manifest decoder accepts the array-shaped `encoding` that every
bundled parser manifest ships (`parser_json`, `parser_protobuf`,
`parser_data_tamer`, `parser_ros`).

A previous refactor narrowed `encoding` to a single `std::string` and
required it via `requiredString()`. As a result every parser was
rejected at scan time with `plugin embedded manifest missing required
string key: encoding` and no parser-backed data source could load.

Changes:
- `PluginDescriptor::encoding` is now `std::vector<std::string>`.
- `decodeManifest` reads `encoding` via `readStringArray` and keeps the
  "non-empty for kMessageParser" requirement.
- `PluginRuntimeCatalog::loadAndRegisterMessageParser` inserts every
  entry into `loaded.encodings` instead of pushing one string.
- Mocks and docs updated to the array shape.
- Unit test updated to compare against `std::vector<std::string>`.

Testing:
- `ctest --test-dir build -R plugin_catalog_test` passes.
- pj_proto_app loads csv, json, protobuf, mcap, parser_ros and the ROS 2
  subscriber after this fix; previously all parsers were ignored at boot.
@facontidavide facontidavide deleted the branch development May 4, 2026 12:12
@pabloinigoblasco
Copy link
Copy Markdown
Collaborator Author

Reopened as #80 against main (the development base branch is no longer in use). Merged in f51bbdb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants