Integrate Flight Recorder relay workflow#69
Conversation
Add a Cloudflare Wrangler/Durable-Object relay backend under flight-recorder/relay-worker (package.json, src/index.ts, tsconfig.json, wrangler.toml) and a README describing deployment and usage as an optional public live-relay for remote viewers. Update flight-recorder documentation and top-level README to mark the app as internal (protected by Cloudflare Zero Trust), clarify store-and-forward behavior, relationship to the old lte-relay approach, optional live-relay semantics (public/tokenless worker, 1 Hz synthetic heartbeat, demo-source behavior), and DBC access/build notes. Also add a LiveRelayService and update WebSocketService and App.tsx to expose guarded controls for WS Relay vs DB forward so live relay can be used independently of database sync.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91ab5e17dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| : `https://${trimmed}`; | ||
| const url = new URL(withScheme); | ||
| url.protocol = url.protocol === 'ws:' || url.protocol === 'http:' ? 'https:' : 'https:'; | ||
| url.pathname = '/session'; |
There was a problem hiding this comment.
Clear stale room params before creating sessions
When the relay box contains a previously generated ingest URL, the UI passes that URL back into createSession and this helper changes only the path to /session, leaving ?room=<old-room> intact. The Worker honors a supplied room query on /session, so pressing the session button after the first run silently reuses the old public viewer/ingest room instead of creating the unique room described by the workflow. Clear the search params before returning the session URL, or keep the input as the Worker origin.
Useful? React with 👍 / 👎.
| viewerUrl: string; | ||
| } | ||
|
|
||
| const HEARTBEAT_CAN_ID = 0x7FD; |
There was a problem hiding this comment.
Align relay heartbeat with PECAN handling
In sessions where the phone has no real CAN traffic to forward, or when demo telemetry is intentionally suppressed, remote PECAN viewers only receive this synthetic frame. PECAN currently recognizes heartbeat/link status only for CAN ID 1999 (0x7CF) in TelemetryHandler, while 0x7FD is just decoded as an unknown empty CAN frame with the current DBC, so the advertised relay heartbeat will not drive the heartbeat/link indication. Either emit the existing heartbeat format or add PECAN handling for this new ID.
Useful? React with 👍 / 👎.
TelemetryHandler: treat both UTS (1999) and flight-relay (0x7FD) CAN IDs as diagnostic heartbeats and ingest them under DIAG_MSG_IDS.HEARTBEAT. RadioStatChips now uses the DIAG_MSG_IDS constant instead of a hardcoded '1999' string. Added TelemetryHandler tests to assert UTS and relay heartbeat frames are routed to the heartbeat diagnostic message. LiveRelayService: strip search and hash when building the /session URL to avoid stale query/hash data; updated its test to stub global fetch and ensure sessions can be created from older ingest URLs. Misc: test cleanup unstubs globals after each run.
Summary
Tests