-
Notifications
You must be signed in to change notification settings - Fork 13k
regression: Voice call keypad doesn't stop on safari #37328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
WalkthroughReworks the tone player: switches the BiquadFilter from lowpass (8000 Hz) to bandpass (4000 Hz), computes a shared startTime (audioContext.currentTime) to start both oscillators synchronously, and replaces setTimeout-based cleanup with absolute WebAudio stop calls scheduled from startTime and durationMs. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant UI as Dialpad / Caller
participant Hook as useTonePlayer
participant Audio as AudioContext / Nodes
UI->>Hook: requestPlayTone(dtmfKey, durationMs)
Note right of Hook #D6EAF8: compute startTime = audioContext.currentTime
Hook->>Audio: createOscillators() & createBiquadFilter(type=bandpass, freq=4000)
Hook->>Audio: connect oscillators -> filter -> destination
Hook->>Audio: oscillator1.start(startTime)
Hook->>Audio: oscillator2.start(startTime)
Note right of Hook #D6EAF8: schedule absolute stop = startTime + durationMs/1000
Hook->>Audio: oscillator1.stop(stopTime)
Hook->>Audio: oscillator2.stop(stopTime)
Audio-->>Hook: nodes stop at stopTime (no setTimeout)
Hook-->>UI: playbackScheduled
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (1)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-7.12.0 #37328 +/- ##
==================================================
+ Coverage 67.59% 67.60% +0.01%
==================================================
Files 3338 3338
Lines 113708 113708
Branches 20649 20651 +2
==================================================
+ Hits 76859 76872 +13
+ Misses 34170 34156 -14
- Partials 2679 2680 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/ui-voip/src/v2/useTonePlayer.ts (1)
69-70: LGTM with suggested improvement: Add explicit disconnect() calls.Using scheduled stop times with the WebAudio API is the correct fix for the Safari regression and should resolve the continuous playback issue. This approach is much more reliable than setTimeout-based cleanup.
Consider explicitly disconnecting the oscillators after they stop to ensure proper resource cleanup, especially given Safari's historical WebAudio issues:
highFrequencyOscillator.stop(startTime + (durationMs ?? 400) / 1000); lowFrequencyOscillator.stop(startTime + (durationMs ?? 400) / 1000); + + const stopTime = startTime + (durationMs ?? 400) / 1000; + // Disconnect oscillators after they finish to ensure cleanup + setTimeout(() => { + highFrequencyOscillator.disconnect(); + lowFrequencyOscillator.disconnect(); + }, ((durationMs ?? 400) + 50)); // Add 50ms buffer
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/ui-voip/src/v2/useTonePlayer.ts(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: 🔎 Code Check / TypeScript
- GitHub Check: 🔨 Test Unit / Unit Tests
- GitHub Check: 🔎 Code Check / Code Lint
- GitHub Check: 📦 Meteor Build - coverage
🔇 Additional comments (1)
packages/ui-voip/src/v2/useTonePlayer.ts (1)
57-60: LGTM: Synchronized oscillator starts.Synchronizing both oscillators to start at the same computed
startTimeensures consistent dual-tone generation and prevents phase/timing issues. This is a good improvement.
1bed630 to
f2bcf05
Compare
f2bcf05 to
38c631d
Compare
Proposed changes (including videos or screenshots)
Issue(s)
VGA-46
Steps to test or reproduce
Further comments
Summary by CodeRabbit