Hi, we have an app which uses UiKit for Android (version 3.5.0), in time we had a number of reports that Pending or Failed messages are impossible to delete. Testing this we found it to be true.
our code:
if ((baseMessage.sendingStatus == SendingStatus.PENDING) ||
(baseMessage.sendingStatus == SendingStatus.FAILED) ||
(baseMessage.sendingStatus == SendingStatus.CANCELED)
) {
mChannel.deleteMessage(baseMessage) {
Log.i("exception", it.toString())
}
} else { //handle via backend call }
basically if the message has not yet left the user’s device, we try to delete using UiKit method, otherwise we do it on our backend.
mChannel.deleteMessage(baseMessage)
doesn’t work, depending on the network status, the exception changes. this is if we tried to remove a message while having no connection:
SendbirdException{code=800120, message=Server is unreachable. Request(DELETE https://api-ece2f80e-7604-4370-8db9-ae82d66d5a43.sendbird.com/v3/group_channels/sendbird_group_channel_299662136_b904095c3a1228d976673ccfc80cbddd8adbc52f/messages/0) failed.Network offline.Connection closed. Current state: CONNECTING.IOException: Unable to resolve host "api-ece2f80e-7604-4370-8db9-ae82d66d5a43.sendbird.com": No address associated with hostname.}
this is the exception if connection is up and working:
SendbirdException{code=400201, message="Message" not found.}
I have to assume that in this case, an API call was made using the url above, which of course failed because the message was never sent and even has a invalid id 0.
It seems that UiKit completely disregards local message storage and only calls APIs
is there any way we can delete pending messages?
Thanks
Also: we know that sometimes messages fail to be sent, but we don’t know why (one time we ran out of storage but I took a long time to notice), is there any way to intercept the failure so we can log it or show it to the user?
// If problem, please fill out the below. If question, please delete.
[UIKit Version]
3.5.0
[Reproduction Steps]
Cause a message to fail
try to delete it
[Frequency]
always
[Current impact]
moderate, failed messages always appear as the last message in the list, impacting the user’s experience. The only thing we can advice users at the moment is to delete app data or uninstall/reinstall