I have issues with the SyncManager. While all fetched / new incoming messages are cached correctly, my outgoing messages (both successfully sent, pending, and failed) disappear.
I do collection?.appendMessage(presendMessage) immediately after sending the message, and then collection?.handleSendMessageResponse(message, error) in the completionHandler block.
SBSMMessageCollectionDelegate callbacks work as expected – I see when pending, failed, and succeeded messages are inserted.
I’ve also noticed that in the sample SyncManager app handleSendMessageResponse(message, error) is never used. There’s another collection?.appendMessage(message) on its place. I’ve tried both versions, and it still doesn’t work for me.
@vlad Hello, I cannot reproduce the issue you described on sample code. So are you saying all out going messages (send by current user) disappear as soon as you send it?
Hello! The messages are sent correctly, and they are fetched with fetchAllNextMessages. However, they are not cached locally. If I send a message, then go offline, then reload the chat from cache – I see all messages except for the new ones that I’ve sent. Then I go back online, call fetchAllNewMessages on reconnection, and my messages are received and cached properly now. So, I have to manually call fetchAllNewMessages each time channel.sendUserMessage succeeds to force SyncManager to store my message because collection.appendMessage doesn’t work.
@Woo I mean I send a message, it’s sent successfully (other users can see it), then I turn airplane mode on, then leave the chat page, open it again, initialize collection, fetch previous messages, fetch next messages – I see all messages except for the one that I’ve sent. Then I turn airplane mode off, and when the app reconnects to the SendBird server I call SBSMSyncManager.resumeSynchronize() and then fetchAllNewMessages inside didSucceedReconnection. Now my message is pushed to collection:didReceive:succeededMessages: and I insert it in the table view. After that if I repeat the same steps with turning airplane mode on, leaving the chat, opening it again – now I see all messages as they should be. Cached properly.
@vlad Hi! I found a solution and will release patch no later than next week. Next patch will include some of other fixes too. Thank you for your patient