Let candidates record webcam or screen, not both - #30
Conversation
Record one input at a time. Setup offers camera or screen sharing, switching before start replaces the other stream, and playback still uses the existing single-session pipeline.
Review SummaryThis PR adds a mutually exclusive webcam-or-screen recording flow, including microphone attachment for screen capture, source-specific previews and messaging, and recovery when screen sharing ends. The existing upload and finalization pipeline remains in use, but the unauthenticated upload path can persist orphaned R2 objects before session ownership is validated. Key Changes:
Confidence Score: 5/5Recommendation: Review findings before merge. Rationale: The changed client flow and the upload/acknowledgement ordering are directly evidenced by the diff and identified server behavior. The storage-abuse path is a concrete security and cost risk with a clear remediation. Special Attention- Validate segment ownership before writing to R2, or delete the uploaded object whenever acknowledgement fails. - Exercise unauthenticated uploads with arbitrary session and segment IDs to confirm orphaned objects cannot accumulate. - Verify microphone and screen-track cleanup across permission failures, switching, and ended screen shares.Important Files Changed
Sequence DiagramsequenceDiagram
participant C as Unauthenticated Client
participant U as Recording Upload Endpoint
participant R as R2
participant D as Session Database
C->>U: Upload arbitrary sessionId/segmentId
U->>R: Write segment object
U->>D: Acknowledge segment ownership
alt Segment belongs to session
D-->>U: Success
U-->>C: Acknowledged
else Unknown or unauthorized segment
D-->>U: 404 / failure
U-->>C: Error
Note over R: Object remains orphaned
end
Audit history |
There was a problem hiding this comment.
🤖 review-bot · openai/gpt-5.6-luna · standard · 143.4s · 923,118 tokens · diff: 10 files · preloaded context: 10 changed + 8 related · policy: github-pr-review, thermo-nuclear-code-quality-review · optional skills invoked: react-useeffect, vercel-composition-patterns, vercel-react-best-practices
Display audio plus a mic track can confuse MediaRecorder, and an ended mic/system track was treated as the user stopping screen share.
Candidates now choose one capture input before recording: webcam or screen share. They cannot run both at the same time.
What changed
Testing
pnpm test(154 passed)