Closed angelolloqui closed 2 years ago
BTW, I think you are running on a thread race condition due to the mutating nature of the token in your plugin. See this for a similar example.
Instead, the token
plugin should be constant (let
) and then maybe reset the networkAuthorization
variable (and the network provider configuration) when token needs to be refreshed
Hello @angelolloqui
Thank you for the report & suggestions!
I'm looking into this and will keep you updated.
Any update on this @b-onc ? it is the most frequent crash in our app, about 10x more than the next top crash
Hi @angelolloqui,
Version 2.2.5 has been released with this fix. Let us know if everything is okay.
Best, Nuno
Awesome! I am updating right now! I will try to report results in a few days. Thanks again for the support!
I can confirm that after almost a month with this on production all crashes have dissapear! thanks!
What did you do?
We have an app with several thousand sessions per day and using the GetStream sdk for an activity feed. We have seen that most of our crash reports (around 90% of them, a total of 0.1% of our total sessions are affected, with our current numbers is about 200 crashes/week) are coming from GetStream Moya plugin. Here is the crash report:
I have tried using the tentative fix contained in cd5dffc725f426701e7800e741937bb123dbee78 but did not help either.
I am not sure what to do next, because it seems like there is some kind of race condition, maybe due to the memory management in the background thread.
Apart from that, in general third party SDKs should minimize dependencies to external libraries to slim them as much as possible, so I wonder why do you need Moya at all instead of implementing the calls yourselves.
What did you expect to happen?
No crash an no big dependencies like Moya or Alamofire included in the SDK
What happened instead?
Crash 0.1% of the sessions (90% of our total crashes)
GetStream Environment
GetStream version: 2.2.2 (and cd5dffc725f426701e7800e741937bb123dbee78 commit too) Xcode version: 13.2.1 (others too) Swift version: 5 Platform(s) running GetStream: iOS and Android macOS version running Xcode: 12.3 (others too)
Additional context
Affecting all iOS versions in expected proportion compared to our userbase:
Affecting to all iPhone devices in expected proportion compared to our userbase:
I do not see any pattern on user behavior. Many happening after a fresh app start, but some exceptions exist too.