fix(react): reset recording toggle state and expose record button errors#2174
fix(react): reset recording toggle state and expose record button errors#2174
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdated call-recording error handling and unified component click handlers to route through a centralized error handler, adjusting component prop types to accept error callbacks. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as "Record Button (UI)"
participant Handler as "createCallControlHandler"
participant Hook as "useToggleCallRecording"
participant Call as "Call API (start/stop)"
UI->>Handler: onClick
Handler->>Hook: invoke toggleCallRecording
Hook->>Call: call.startRecording() / call.stopRecording()
alt success
Call-->>Hook: resolved
Hook-->>Handler: update isAwaitingResponse=false
Handler-->>UI: success callback
else failure
Call-->>Hook: throws error
Hook-->>Hook: set isAwaitingResponse=false
Hook-->>Handler: rethrow error
Handler-->>UI: call onError with error
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/react-sdk/src/components/CallControls/RecordCallButton.tsx`:
- Around line 51-53: The "End recording" CompositeButton is still clickable
while isAwaitingResponse, allowing duplicate stop requests; update the
RecordCallButton to guard the confirmation like the other buttons by preventing
clicks and visual state change when isAwaitingResponse: add a disabled (or
equivalent) prop to CompositeButton and/or wrap handleClick so it returns early
if isAwaitingResponse, and keep showing LoadingIndicator instead of the label;
reference CompositeButton, handleClick, and isAwaitingResponse when making the
change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a4c98a0d-592a-4361-a341-595e2f994afb
📒 Files selected for processing (2)
packages/react-bindings/src/hooks/callUtilHooks.tspackages/react-sdk/src/components/CallControls/RecordCallButton.tsx
💡 Overview
This PR fixes an issue where the record button gets stuck in a loading state when startRecording/stopRecording fails. Additionally
RecordCallButtonandRecordCallConfirmationButtonnow accept anonErrorprop so consumers can surface recording failures to users.🎫 Ticket: https://linear.app/stream/issue/REACT-932/reset-recording-toggle-state-and-expose-record-button-errors
Summary by CodeRabbit
Bug Fixes
Enhancements