splitio / ios-client

iOS SDK client for Split Software
https://split.io
Other
11 stars 18 forks source link

on(event:runInBackground:execute:) Never Executes #541

Open vincentesm opened 4 months ago

vincentesm commented 4 months ago

Hello,

I am facing an issue similar to the one described in SDK Ready Not Firing #512 where the on(event:runInBackground:execute:) method does not return with the .sdkReady event when the SDK is initialized.

I am noticing that the clientManager is nil in the DefaultSplitClient when the on(event:runInBackground:execute:) is called. DefaultSplitClient.swift Line 80.

On a brief look into the cause, the method does call back if I remove the weak reference from clientManager in the same file. DefaultSplitClient.swift Line 25. I realize this may not be the fix, but I hope that it is helpful in debugging.

Please let me know if I can provide any other details. Thank you.

Environment

jsahoo commented 3 months ago

I'm having the exact same issue.

Environment

javrudsky commented 3 months ago

Hi @vincentesm and @jsahoo, Thank you for the info. Just to be sure, did you try version 2.24.7? Also it would be good if you can provide you're integration code so that we can test that scenario.

samshiffman321 commented 2 months ago

I am also experiencing this issue on the latest version 2.25.1

gtsifrikas commented 1 month ago

Any update on this?

javrudsky commented 1 month ago

Hi, I was able to reproduce this issue when there is only a local reference to the factory in the method where it is instantiated. If you’re encountering the same situation, you can work around the issue by maintaining a module reference.

alexfu commented 4 days ago

This particular comment hinted at a solution: https://github.com/splitio/ios-client/issues/512#issuecomment-2070944224

So, the TL;DR is that if you don't have a strong reference to SplitFactory, that may be the reason why you are not getting events fired.