Duplicate Delegate Calls

I’m in the process of updating the mobile SDK from 5.1.0 to 7.0.1 for iOS. I have it compiling and running just fine inside our project, however, all of the delegate methods are getting called twice. “conferenceWillJoin”, “conferenceJoined”, etc…

Has anyone else noticed this issue? I’ve confirmed in the jitsi console logs where the “sendEvent()” happens only one time each, and I’ve confirmed I only have one instance of our JitsiMeetDelegate class via Xcode instruments.

FWIW we are not aware of this issue. Are you just using a delegate on the view?

Correct, I have a delegate class that handles all of the delegate logic which is assigned to the JitsiView.

Just for more information, using the same environment (Xcode version, npm, cocoapods) I verified that 5.1.0 triggers the methods only 1x, but all later SDKs trigger them 2x.

Can you please open an issue on GH?

@saghul I have sorted out the problem. I added some logging in JitsiMeetView.m and was able to verify that two of the init functions are triggered, thus causing the duplicate calls for initWithXXX thus calling registerObservers twice.

In our project, I’ve been initializing the JitsiMeetView like this:
currentJitsiView = JitsiMeetView()
we set the frame at a later time.

I updated that to be:
currentJitsiView = JitsiMeetView(frame: frame)

this has fixed the duplicate init calls in JitsiMeetView.m where only initWithFrame:(CGRect)frame is called, and registerObservers is now only called once.

Still seems buggy, can you still open an issue so we don’t forget? Also, if you have a PR to fix it, that would be even better :slight_smile:

I’ll open an issue, but it’s not a fix inside your code. The fix is inside our project where we are initializing the JitsiMeetView. Instead of just calling “init()” we are now calling “initWithFrame()”.

GH issue here:

Thanks! I think the bug is in our code. If initWithFrame ends up calling init underneath then we need to not call “initWithXXX” twice.

@saghul I now have a M1 laptop and discovered today that the build script needs to be updated for the fact that iOS simulators are in fact arm64 on the M1 processors. Can you guys put a note in the handbook about this?

I’m not aware of the need for any chance. What did you need to change?

For the simulator build, you have:
VALID_ARCHS= x86_64

for the M1 Mac, I had to change it to:
VALID_ARCHS=arm64

so, now both the simulator build and device build are the same architecture on the M1 Macs.

I think we refactored that. What commit are you using? I cannot find a reference to VALID_ARCHS anymore on master.

From the dev handbook:

Ah right. I just updated it, thanks for the pointer!