5.0 KiB
5.0 KiB
Absolute Checklist: Streaming Simplification (WebRTC-only)
Backend
- Add/confirm
SIMPLE_STREAMINGenvironment/config switch (default: true for new deployment profile). - In
Backend/routes/streams.ts, updatePOST /streams/requestto:- keep device role/link validation
- create session with status
requested - emit request event directly compatible with WebRTC-only flow
- remove stream-provider payload assumptions from response
- In
Backend/routes/streams.ts, updatePOST /streams/:id/acceptto:- validate camera ownership and state
- set status to
streaming - set
startedAt - emit
stream:started - remove or gate all publish/subscribe/media-provider dependency
- In
Backend/routes/streams.ts, updatePOST /streams/:id/endto:- require authorized participant (camera or requester)
- set status to
ended - set
endedAt - emit
stream:ended - stop any active SFU session only if explicitly still active and configured
- In
Backend/routes/streams.ts, remove any hard dependency onmediaProvider.createSessionfor live functionality. - Gate recording creation in stream end logic behind feature flag (default OFF) or remove endpoint path from phase-1 path.
- In
Backend/routes/streams.ts, return minimal deterministic payload for stream start/accept/end responses. - In
Backend/db/schema.ts, mark legacy media fields as deprecated comments only (no schema migration required in phase 1). - In
Backend/media/service.ts, make provider calls no-op for phase-1 streaming runtime or guard them behind non-simplified feature flag. - In
Backend/media/providers/mock.ts, annotate mock provider methods as metadata-only and remove calls from request/accept/end flow. - In
Backend/media/sfu/service.tsandBackend/media/sfu/noop.ts, ensure no required startup path is executed for default simplified mode. - In
Backend/routes/commands.ts, document command-table deprecation for stream lifecycle command path; remove active usage if simplified mode is enabled.
Realtime Gateway
- In
Backend/realtime/gateway.ts, removestream:frameevent listener and sender path. - In
Backend/realtime/gateway.ts, remove frame-relay participant cache and related validation branch. - In
Backend/realtime/gateway.ts, keep only validatedwebrtc:signallogic for offer/answer/candidate/hangup. - In
Backend/realtime/gateway.ts, simplify signal forwarding so target validation is session ownership + same user context. - In
Backend/realtime/gateway.ts, remove periodic command retry polling for stream commands when in simplified mode. - Keep
stream:startedandstream:endedemit paths with recipient resolution. - Ensure socket middleware still enforces device token auth and role identity checks.
Web frontend
- In
WebApp/src/lib/app/controller.js, collapse stream state toidle|connecting|active|ended. - Remove fallback image mode, latest-frame state, and frame receiver logic from controller.
- Ensure client side only uses WebRTC peer connection and
<video>rendering path. - Simplify
ontrackhandling to set remote stream once and ignore duplicate tracks. - Add deterministic peer teardown on
stream:ended, page unload, and navigation changes. - In
WebApp/src/routes/camera/+page.svelte, remove preview-to-frame interval fallback sender. - In
WebApp/src/routes/camera/+page.svelte, ensure camera-side stream path emits offer only and no JPEG payload. - In
WebApp/src/routes/camera/+page.svelte, remove recording branch that depends on frame transport. - In
WebApp/src/routes/client/+page.svelte, remove fallback image DOM branch and related status labels.
Mobile frontend
- In
MobileApp/src/app-context.tsx, remove base64 frame stream state and timer lifecycle for frame relay. - In
MobileApp/src/app-context.tsxandMobileApp/app/(tabs)/index.tsx, align stream lifecycle state transitions with web logic. - In
MobileApp/app/(tabs)/index.tsx, remove capture+stream:frameemission loop. - In
MobileApp/app/(tabs)/index.tsx, remove any image fallback UI path and render strategy for active stream. - In
MobileApp/src/api.ts, remove calls to publish/subscribe credentials endpoints from simplified runtime flow. - Ensure mobile camera cleanup stops local media and closes RTCPeerConnection on end and unmount.
Cross-cutting API/docs/config
- In
Backend/docs/openapi.ts, update documented streaming contract to only include:
- request
- accept
- end
- webrtc signal event behavior
- remove references implying frame fallback as primary path
- Update any internal docs or README sections describing mock media endpoints as runtime-critical.
- Add migration notes to avoid breaking integrations (deprecation and rollback behavior).
- Add explicit log markers for stream request/accept/offer/answer/end events with session id and participant ids.
- Add compile/build compatibility checks for both apps after removing unused symbols/imports.
- Add runtime rollback checklist for disabling
SIMPLE_STREAMINGand re-enabling legacy paths.