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

[iOS SDK] Unexpected delegate callbacks after disconnecting from a call #85

Closed
ryanespiritu opened this issue Oct 30, 2020 · 7 comments
Closed
Assignees
Labels
Bug Something isn't working Calling Issue involves Calling functionality. iOS Issues involving the iOS SDK

Comments

@ryanespiritu
Copy link

Hi All,

We came across an interesting scenario regarding the lifecycle of an ACSCall. Locally we have a “Call Manager” class setup that maintains a reference to the ACSCall and implements ACSCallDelegate and ACSRemoteParticipantDelegate. We noticed that after disconnecting from a call and releasing our “Call Manager” object, we still would receive callbacks for ACSCallDelegate and ACSRemoteParticipantDelegate to our now released object which in turn caused exceptions to occur.

Our hypothesis is that the ACS objects strongly retain our “Call Manager” object as their delegate, so even after the call is disconnected from our PoV, the extraneous events will still try to propagate back to the released delegate. For some context, the delegate callbacks we received after leaving the call were events for onRemoteParticipantsUpdated, onParticipantStateChanged, etc. which were related to the other participant in the call at the time. It seems like that even after disconnecting from the call, ACS may perform some extra clean-up work related to removing the remote participant resources.

While we do have a workaround to set the delegates to nil in the dealloc of our “Call Manager”, we were wondering if this implementation was intended as it makes things a bit tricky when trying to manage the lifecycle of the call and knowing when to release our local objects.

Any guidance on how a call + lifecycle is intended to be managed would be much appreciated, thank you!

@ProbablePrime
Copy link
Contributor

Hey @ryanespiritu, Thanks for your issue. I've assigned @mariusu-msft to take a look at your inquiry. They should reply soon.

@ProbablePrime ProbablePrime added Calling Issue involves Calling functionality. Needs: attention 👋 Question A question has been asked, which needs an answer. labels Oct 30, 2020
@ghost
Copy link

ghost commented Oct 30, 2020

Hey @mariusu-msft, this issue has been marked as needing attention. Please review the issue and remove the Needs: Attention label if this was done in error. Thank you!

@terrychen1122
Copy link

To add a little color here,

  1. we can not release the reference of ACSCall even after the hangup completion block tells us success until all the delegate methods have been invoked, acs tells us via delegate that:
  • remote participants' states become 'disconnected'
  • video streams of these remote participants are removed
  • remote participants are removed from the call
    As Ryan mentioned, if we release the reference of ACSCall and ACSRemotePartcipants before all of these happen, we will see exception and crash
    Not sure why, but shouldn't ACS not do anything if the delegates are released
  1. Also, we found out that if we release the reference to ACSCall but do not hang up the call, the call is still running and there is no way we could hang up. My expectation is when the reference of an activeACSCall is released, the call should end automatically.

@mariusu-msft
Copy link
Member

Hi,

For 2nd point, we can take that under consideration as a feature request, it does not currently happen. Please open a new issue for this one so we can track the ask.

For 1st point, that is a known bug, after hang-up there should be no more events showing up.

-Marius

@mariusu-msft mariusu-msft added Bug Something isn't working and removed Needs: attention 👋 Question A question has been asked, which needs an answer. labels Oct 30, 2020
@terrychen1122
Copy link

Thanks @mariusu-msft . When should we expect a fix for the known bug?

@mariusu-msft
Copy link
Member

Bug is assigned to @sankum-msft, targeting current sprint.

We will try to do a public release in week of 15th.

-Marius

@mariusu-msft
Copy link
Member

This should be now fixed. Please reopen if you encounter same issue again.

@mariusu-msft mariusu-msft added the iOS Issues involving the iOS SDK label Dec 2, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Calling Issue involves Calling functionality. iOS Issues involving the iOS SDK
Projects
None yet
Development

No branches or pull requests

5 participants