Skip to content

Integrate Flight Recorder relay workflow#69

Merged
haoruizhou merged 4 commits into
mainfrom
recorder-upload
May 19, 2026
Merged

Integrate Flight Recorder relay workflow#69
haoruizhou merged 4 commits into
mainfrom
recorder-upload

Conversation

@haoruizhou

Copy link
Copy Markdown
Contributor

Summary

  • update repo docs around UTS, Flight Recorder, AGENTS.md, and WebSocket runtime notes
  • add the Flight Recorder live relay workflow with separate guarded WS Relay and DB Forward controls
  • add a public Cloudflare Worker/Durable Object relay backend for per-session ingest/viewer WebSockets
  • block hosted demo telemetry from relay sessions while preserving the 1 Hz FA AA FA AA heartbeat
  • document internal FDR deployment, DBC token behavior, and correct PECAN default WebSocket routing

Tests

  • npm test --prefix flight-recorder
  • npm run build --prefix flight-recorder
  • cd flight-recorder/relay-worker && npx tsc --noEmit
  • git diff --check

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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.
@haoruizhou haoruizhou merged commit 2dcd7f1 into main May 19, 2026
11 checks passed
@haoruizhou haoruizhou deleted the recorder-upload branch May 19, 2026 03:40
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.

1 participant