-
Notifications
You must be signed in to change notification settings - Fork 212
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
Chat Client crashes upon initialization #954
Comments
@39otrebla Thank you for the bug report! The fact that the crash happens also for clean installations is important. Would you mind sharing the full stack trace of the crash with me, please? |
Probably unrelated but I noticed that you set Can you please confirm the crash still happens when you remove |
@VojtaStavik To reduce session-related stuff as much as possible I temporarily switched to "static" tokens, i.e. backend returns a StreamChat token without expiration upon user login (along with our own session data). No luck. It's still happening, here is the code. private var clientConfig: ChatClientConfig?
private var apiKey: String? {
didSet {
clientConfig = ChatClientConfig(apiKeyString: apiKey ?? "")
clientConfig?.baseURL = .dublin
clientConfig?.shouldConnectAutomatically = true
clientConfig?.shouldFlushLocalStorageOnStart = false
clientConfig?.localCaching.chatChannel.lastActiveMembersLimit = 2
clientConfig?.localCaching.chatChannel.lastActiveWatchersLimit = 2
}
}
[...]
client = MyChatClient(config: clientConfig,
tokenProvider: .static(tokenStruct), // this token (exactly this one) works on 3.1.3
completion: { error in
guard error == nil else {
// TODO
return
}
}) |
@39otrebla Thank you for more details. Can you please include the crash stack trace, too? On which thread is the |
@VojtaStavik the ChatClient is initialized on the Main thread. It turned out to be the CoreData concurrency debug build argument, so it's not crashing in release builds. |
What did you do?
I upgraded from version 3.1.1 to version 3.1.4 of the StreamChat SDK.
What did you expect to happen?
I expected to see new Channel properties working.
What happened instead?
App crashed upon client initialization. It does happen both with clean installs and installing over previous data (BTW, it seems that a CoreData migration is needed upgrading from 3.1.1, and the crash happens right after migrating).
Crash is in
NSManagedObjectContext+Extensions
:The crash is a bad access:
Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
, happening in theset
hook.GetStream Environment
GetStream Chat version: 3.1.4
GetStream Chat frameworks: StreamChat
iOS version: 14.4
Swift version: 5.2
Xcode version: 12.4
Device: both simulators and real devices
Additional context
It is happening 100% of the times, i.e. our app is completely stuck. Here is how we initialize it:
The text was updated successfully, but these errors were encountered: