Skip to content

[Frontend] feat(testing-view): adapt to the new backend's catalogs and WebSocket topics - #688

Open
jeereemiassb wants to merge 6 commits into
new-backendfrom
frontend/new-backend-http
Open

jeereemiassb wants to merge 6 commits into
new-backendfrom
frontend/new-backend-http

Conversation

@jeereemiassb

Copy link
Copy Markdown
Contributor

Adapts testing-view to the new Rust backend: the ADJ catalogs it serves over HTTP and the WebSocket topics of station::payload.

It includes #686 (3423725), so merging this one merges that too. It also brings Javier's ws_test example and a fix in frontend-kit for topic subscriptions.

Features

Catalogs (HTTP)

  • Fetch packets, orders and protections from adj/DataPackets, adj/OrderPackets and adj/ProtectionPackets.
  • Identify measurements by alias. Order parameters come with their measurements and protections instead of safe/warning ranges.
  • order/send sends every parameter by alias with the type the backend validates: its wire type (float32…), bool or enum, with enum values by option name.
  • Mocks updated to the new shapes.

WebSocket

  • podData/update: measurements arrive keyed by their numeric ADJ id and are keyed back by alias.
  • protection/update: highlights the measurement until the messages are cleared ([Frontend] feat(testing-view): highlight measurements that trigger a protection #686) and shows a message with the board, name, condition and severity from the ADJ catalogs.
  • message/update: protections a board sends are shown as protections (warnings, which only carry a text, as messages), with the value rounded and its limits: Value: 74.05 (Limit: 70).
  • backend/message: messages the backend itself produces, labelled with the board they concern, or Backend.
  • Timestamps carry the date and are shown as they arrive: the payload contract applies no timezone conversion.
  • Closed messages take a single row, with their icon at the end.

frontend-kit

  • A topic stays subscribed while any useTopic listener is left. The backend keeps one subscription per topic and connection, so one listener unmounting stopped the topic for the rest: leaving Logs stopped logger/response for the header.

Backend

  • ws_test example: serves station's HTTP API and WebSocket without an ADJ and publishes fake updates on every topic.

How to test

cd backend && cargo run -p station --example ws_test   # http://127.0.0.1:4000
cd frontend/testing-view && pnpm dev                   # http://localhost:9000
  • Connections: VCU stays connected, PCU toggles every 5 s.
  • One message every 3 s: an info text, a board protection (UPPER BOUND), a protection/update and a backend message about PCU.
  • ws_test serves no ADJ, so Telemetry and Commands stay empty and its protection shows as Unknown · Protection 8704, "Not in the ADJ". With an ADJ, protections resolve to their board, measurement, condition and severity.
  • pnpm test in frontend/testing-view.

Known issues

  • Heartbeat: frontend-kit sends one every 25 ms and the backend's default timeout is 100 ms. Measured gaps reach ~85 ms in dev and go over 100 ms with 4× CPU throttling, even in a production build, and background tabs always time out. With no other frontend that ends in FrontendDisconnected, so the backend's timeout probably needs to be higher.
  • ws_test timestamps are UTC.

jeereemiassb and others added 6 commits December 3, 2026 20:00
Subscribe to protection/update and keep the last protection of each
measurement, keyed by the low 13 bits of the compound protection id.
The measurement row turns red with a shield icon until the messages are
cleared, since the new protocol sends no recovery event.

Measurements are matched by a new optional Variable.adjId (numeric ADJ
id), which the new adj/DataPackets catalog has to fill.
- Fetch packets, orders and protections from adj/DataPackets,
  adj/OrderPackets and adj/ProtectionPackets
- Identify measurements by alias and command params by a measurements
  array with their protections instead of safe/warning ranges
- Show triggered protections as messages and categorize messages by
  the topic they arrive on (message/update, backend/update)
- Update mocks to the new shapes
…ackend-http

# Conflicts:
#	frontend/testing-view/src/mocks/telemetry.ts
- Key podData/update measurements by alias (the backend sends numeric ADJ ids)
- Read backend messages from backend/message
- Messages and protections carry the full date in their timestamp
- Keep a topic subscribed while any useTopic listener is left: the backend
  keeps one subscription per topic and connection, so one listener
  unmounting stopped the topic for the rest
…backend sends them

- Protections boards send on message/update are shown as protections
  (warnings, which only carry a text, as messages), with the value
  rounded and its limits: "Value: 74.05 (Limit: 70)"
- protection/update shows the rounded value and its condition, and says
  which protection it is when the ADJ doesn't have it
- backend/message shows the board it concerns, or Backend, and its text
  as title
- Closed messages show their icon at the end of the row

This branch has not been deployed

No deployments
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