Skip to content
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

Fix endless ringing in ring-notification #701

Merged
merged 1 commit into from
Jan 11, 2025
Merged

Conversation

dremin
Copy link
Contributor

@dremin dremin commented Jan 7, 2025

Summary

When receiving multiple tasks, and they are both alerting at the same time, we would overwrite the mediaId of the first task, so we could not stop it when accepting. We avoid that scenario by returning in the play function if we are already playing.

As an initial attempt at the fix, I tried stopping the initial media when the second play was invoked, however, I found that in the case multiple reservations come to you at the same time, the stop would not actually prevent it playing when it was called before the audio file loaded. This may be an issue with the Flex AudioPlayerManager, but I did not look into this much further as the solution I landed upon seems to work well.

Checklist

  • Tested changes end to end
  • Requested one or more reviewers

@dremin dremin requested a review from trogers-twilio January 7, 2025 00:22
Copy link

github-actions bot commented Jan 7, 2025

0 ESLint error(s) and 0 ESLint warning(s) found in pull request changed files.
✅ No issues found!

Copy link

@trogers-twilio trogers-twilio left a comment

Choose a reason for hiding this comment

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

Nice catch. For future enhancement, we might want the ringing to begin again if there's still a reservation in pending after the current ringing one has triggered a stop. But not something to deal with in this PR.

@dremin dremin merged commit e9a83aa into main Jan 11, 2025
4 checks passed
@dremin dremin deleted the fix-endless-ringing branch January 11, 2025 00:01
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.

2 participants