Fix topic data request causing 400 error#76
Merged
Conversation
Correct the request handling for topic data fetching in the Data tab to ensure published ROS 2 topic messages are displayed properly on ROS 2 Humble. This resolves the 400 Bad Request error observed in the browser.
bburda
approved these changes
May 15, 2026
Contributor
bburda
left a comment
There was a problem hiding this comment.
Thanks for the contribution, and welcome - great first PR! 🎉
The root-cause analysis is spot on: depth-based entity-type inference breaks in runtime_only (function/app) mode, and resolving the parent node's real type from the loaded tree is the right fix. CI is green and the change is well-scoped.
Approving and merging. A few small polish items (a regression test plus minor comment/typo cleanups) are tracked in #77 and we'll handle them in a quick follow-up - nothing needed from you.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary
Fix incorrect entity type resolution while fetching topic data in the Data tab.
Previously, entity types were inferred using path depth assumptions from parseTreePath(). In runtime-only (function/app) hierarchy mode, this could incorrectly resolve app resources as components, generating invalid API routes such as:
/components/{id}/data/{topic}
instead of:
/apps/{id}/data/{topic}
This caused 400 Bad Request responses from the gateway and prevented published ROS 2 topic messages from being displayed in the UI.
This PR introduces parent entity type resolution using the actual loaded tree hierarchy before dispatching API requests. The correct SOVD resource type is now used consistently for topic data and entity detail fetches while preserving existing fallback behavior.
Issue
Link the related issue (required):
Type
Testing
Tested locally using the provided VSCode devcontainer environment with:
Verification steps:
Verified that:
Additionally verified with:
Checklist
npm run lint)npm run build)