Skip to content

fix: preserve underscores in fault entity_id#56

Merged
mfaferek93 merged 1 commit intomainfrom
fix/fault-entity-id-underscore
Apr 3, 2026
Merged

fix: preserve underscores in fault entity_id#56
mfaferek93 merged 1 commit intomainfrom
fix/fault-entity-id-underscore

Conversation

@mfaferek93
Copy link
Copy Markdown

@mfaferek93 mfaferek93 commented Apr 2, 2026

Summary

transformFault() was replacing underscores with hyphens in entity_id extracted from reporting_sources. This broke fault detail fetching - FaultsPanel called e.g. GET /apps/tank-process/faults/... instead of /apps/tank_process/faults/..., getting 404.

Changes

  • src/lib/transforms.ts: remove nodeName.replace(/_/g, '-')
  • src/lib/transforms.test.ts: update expectations to preserve underscores

Test plan

  • 246/246 tests pass
  • Verified on real hardware: fault detail with snapshots now loads correctly

Fixes #55

transformFault() was replacing underscores with hyphens in entity_id
(e.g., tank_process -> tank-process). This broke fault detail fetching
because the actual SOVD entity ID uses underscores.

Remove the replace(/_/g, '-') call. ROS 2 node names use underscores
and gateway SOVD IDs preserve them.

Fixes #55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes incorrect fault entity_id normalization in the frontend transform layer so faults with underscores in their reporting source correctly map to SOVD entity IDs (preventing 404s when fetching fault details/environment snapshots).

Changes:

  • Updated transformFault() to preserve underscores in entity_id extracted from reporting_sources.
  • Updated unit tests to assert underscore-preserving behavior and adjusted test descriptions accordingly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/lib/transforms.ts Stops converting underscores to hyphens when deriving entity_id from reporting_sources.
src/lib/transforms.test.ts Updates expectations and test name to validate underscore preservation.

Copy link
Copy Markdown
Contributor

@bburda bburda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mfaferek93 mfaferek93 merged commit c59ecd0 into main Apr 3, 2026
7 checks passed
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.

Bug: fault entity_id underscore-to-hyphen conversion breaks fault detail fetch

3 participants