Repository navigation
v5.1.2
New
- None
Enhancements
- Improved how the offline cache decides which conversations to keep. A conversation first cached from a server response now uses its last activity time as its access time, so scrolling through the whole conversation list no longer evicts the conversations in active use. If a user opens a conversation or receives a message in it before it is cached, that access now counts once the conversation is stored.
- Improved media sends with offline support enabled. When a media message exceeds the media cache budget, the SDK now evicts the least recently used cached media to make room. The send fails only when the file still cannot fit. Upload copies of messages still being sent no longer count against the budget.
Fixes
- Fixed
MessagesRequestBuilder.hideQuotedMessages(true)having no effect. The request now sends the query parameter the server reads. - Fixed
deleteGroup()leaving the deleted group's conversation, messages, media, queued messages, pins and saved messages in the offline cache. They are now removed after the call succeeds. - Fixed
retryMessage()anddiscardLocalMessage()returning without a callback when given anullid. Both now fail withERROR_OFFLINE_MESSAGE_NOT_FOUND. - Fixed a second
fetchNext()call on aConversationsRequestorBlockedUsersRequestwhile the first call is still loading. It now returns an empty page right away, online or offline, without serving cached results or moving to the next page. - Fixed an exception thrown from an app's
MessageSentListenerorOfflineMessageListenercallback stopping the other listeners and crashing the app on the main thread when offline support is enabled. Each callback now runs on its own and the exception is logged. With offline support disabled, callbacks behave as before. - Fixed a new message failing permanently when the offline queue could not save it. The SDK now sends the message directly, as it does with offline support disabled.
- Fixed a queued message with several files sending only some of them after an app restart when one of the files was no longer available. The whole message now fails, so the user can retry or discard it.
- Fixed the conversation list not showing a pending or failed status for a last message that has not been sent yet. The conversation's
lastMessagenow carries the send status. - Fixed the conversation list showing an older last message in place of a newer one. This happened when an earlier message finished sending while a newer one was still pending, when a reaction or reply count arrived for an older message, or when a server page held an older last message than the cache.
- Fixed messages loaded with a jump-to-message or timestamp cursor being saved to the offline cache when they did not connect to the messages already cached, which left gaps in offline history. These pages are still shown but are no longer saved. This also applies to filtered and thread message lists.
- Fixed the newest page of cached messages leaving out queued messages when there were more of them than the page limit. The newest page now includes every queued message, and the next older page continues from the sent messages.
Breaking Changes
-
Removed the listener callbacks that fired on the acting device for its own pin, save and conversation pin actions.
MessageListener.onMessagePinned,onMessageUnpinned,onMessageSaved,onMessageUnsavedandConversationListener.onConversationPinned,onConversationUnpinnednow fire only for actions by other users or from the user's other devices. If your app updates its UI from these callbacks for the current device's own actions, move that update into theonSuccesscallback ofpinMessage(),unpinMessage(),saveMessage(),unsaveMessage(),pinConversation()orunpinConversation(). If you use the Android UI Kit, upgrade it to 6.3.0 with this release; it already works this way.Before (5.1.0 and 5.1.1):
CometChat.pinMessage(messageId, new CometChat.CallbackListener<BaseMessage>() { @Override public void onSuccess(BaseMessage message) { } @Override public void onError(CometChatException e) { } }); // MessageListener.onMessagePinned(message) also fired on this device and updated the UI.
After (5.1.2):
CometChat.pinMessage(messageId, new CometChat.CallbackListener<BaseMessage>() { @Override public void onSuccess(BaseMessage message) { updatePinnedUi(message); } @Override public void onError(CometChatException e) { } }); // MessageListener.onMessagePinned fires only for pins by other users or your other devices.
Deprecations
- None