I updated the sendbird iOS framework to the latest version (v3.0.204) but it’s crashing when simultaneous calls to SBDMain.getTotalUnreadMessageCount are made. If I go back to my previous version everything works fine.
It seems like SDK couldn’t get current user information properly at the time you call the method. Would you mind to check you call this method after connect: method? or is this happening 100% when you call this method? and you said you call the method simultaneously meaning you call the method multiple time concurrently?
This is happening 100% when I call this method twice (probably from multiple threads). To test it just make two calls one after the other and it will always crash. This same code didn’t crash with previous versions of the SDK.
I tried to reproduce it on sample code but it won’t crash I tried to run it on both main and background. I know it wouldn’t crash on previous version but I’m trying to find out why current user information couldn’t get retrieved. If you see the log /v3/users/(null)/unread_message_count indicating that SBDMain.getCurrentUser was somehow return nil at the time.
Probably is some race condition. I do sendbird authentication on background and then after a new app launch if it’s already logged in l call the getTotalUnreadMessageCount from other parts in the app so I could be that the getTotalUnreadMessageCount call is being done before auth but I would expect an error instead, not a crash
oh ok thats correct! It shouldn’t crash I already knew the source of crash, just wondering why current user is not get retrieved properly. Your last comment make sense to me now then. I am planning to release new version this Friday. Thanks for your patience!