Problem:
The iOS app crashes whenever a channel is deleted regardless of whether it was deleted in the app or from the SendBird dashboard.
Steps to reproduce:
- Initialize SBD with SBDMain.initWithApplicationId() and then connect with SBDMain.connect()
- Fetch the user’s channels with SBDGroupChannelListQuery.loadNextPage()
Everything works as expected up to this point. I am fetching the channels I previously created perfectly fine.
- Delete the channel either with the iOS sdk or on the dashboard. The app will now crash
Throw Call Stack:
0 CoreFoundation 0x000000010fb2ffba __exceptionPreprocess + 242
1 libobjc.A.dylib 0x0000000119860ff5 objc_exception_throw + 48
2 SendBirdSDK 0x00000001157700d3 +[SBDMessageDatabase removeAllMessagesWithChannelUrls:] + 514
3 SendBirdSDK 0x000000011580d0ba -[SBDCommandProcessor processChannelDeleted:] + 357
4 SendBirdSDK 0x000000011580b293 -[SBDCommandProcessor processSystemEvent:sender:] + 676
5 SendBirdSDK 0x0000000115807294 -[SBDCommandProcessor processCommand:shouldHandleBlock:] + 511
6 SendBirdSDK 0x000000011575bae5 __103+[SBDMain connectWebSocketServerReconnect:userId:accessToken:sessionKey:fromOnError:completionHandler:]_block_invoke.423 + 197
7 SendBirdSDK 0x00000001157f1399 -[SBDWebSocketClient webSocket:didReceiveMessage:] + 376
8 SendBirdSDK 0x00000001157a3266 __35-[SBDSessionWebSocketEngine listen]_block_invoke_4 + 156
9 libdispatch.dylib 0x000000011c321578 _dispatch_call_block_and_release + 12
10 libdispatch.dylib 0x000000011c32274e _dispatch_client_callout + 8
11 libdispatch.dylib 0x000000011c328f9a _dispatch_lane_serial_drain + 796
12 libdispatch.dylib 0x000000011c329c67 _dispatch_lane_invoke + 436
13 libdispatch.dylib 0x000000011c335a7a _dispatch_workloop_worker_thread + 872
14 libsystem_pthread.dylib 0x000000011c7f545d _pthread_wqthread + 314
15 libsystem_pthread.dylib 0x000000011c7f442f start_wqthread + 15
I believe the problem is in SBDMessageDatabase.removeAllMessagesWithChannelUrls()
The application is connected to the sendbird sdk through a websocket and when it tries to remove all the messages in the channel, the application crashes and throws the error: “Terminating app due to uncaught exception ‘Sendbird Exception’, reason: ‘Database error.’”
Please make an update to resolve this issue.
Thanks