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

[BUG] _OnAnswer handler not being cleaned up in _cleanupEventListeners #87

Closed
scottwthompson opened this issue Apr 14, 2022 · 12 comments
Closed
Labels
bug Something isn't working jira added

Comments

@scottwthompson
Copy link

  • [x ] I have verified that the issue occurs with the latest twilio.js release and is not marked as a known issue in the CHANGELOG.md.
  • [ x] I reviewed the Common Issues and open GitHub issues and verified that this report represents a potentially new issue.
  • [ x] I verified that the Quickstart application works in my environment.
  • [ x] I am not sharing any Personally Identifiable Information (PII)
    or sensitive account information (API keys, credentials, etc.) when reporting this issue.

_OnAnswer handler not being cleaned up in _cleanupEventListeners

Noticed in my logs
image

I think this PR here: #42 introduced the regression where your rebinding _onAnswer on every accept call but the this._pstream.removeListener('answer', this._onAnswer) call is now unsuccessful.

@scottwthompson scottwthompson added the bug Something isn't working label Apr 14, 2022
@bradleyy1012
Copy link

Same, glad to see I wasn't the only one with this issue.

@awwsnappitsrob24
Copy link

Does anyone have any updates on this?

@amrictor
Copy link

Waiting eagerly for a fix on this!

@bradleyy1012
Copy link

I'm not sure if this will cause any unexpected side effects, but could this be the solution?
Screen Shot 2022-04-26 at 2 43 53 PM

@katie-bowman
Copy link

I have also experienced this bug, is there any update on this issue?

@mhuynh5757
Copy link
Collaborator

Hi all, thanks for bringing this one to the team's attention. We have filed an internal ticket to track this.

@kamalbennani
Copy link
Contributor

Hi @mhuynh5757 the fix should be very straightforward here by just turning the _onAsnwer instance method to an arrow function, isn't it?
Do you want me to pull up a PR for it?

@mhuynh5757
Copy link
Collaborator

Hi @kamalbennani, thanks for the solution, but unfortunately that might not work due to the possibility of multiple answer events since we now have call reconnection logic, and using an arrow function means we won't be able to unbind properly.

@kamalbennani
Copy link
Contributor

I misread the situation then 🤔

@charliesantos
Copy link
Collaborator

@bradleyy1012 's suggestion is correct. We will include the fix for this as part of #145

@bradleyy1012
Copy link

@bradleyy1012 's suggestion is correct. We will include the fix for this as part of #145

Great to hear, thank you! Credit goes to @amrictor.

@charliesantos
Copy link
Collaborator

Should be fixed in 2.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jira added
Projects
None yet
Development

No branches or pull requests

8 participants