MemoryChatLocalDatasource class

In-memory implementation of ChatLocalDatasource. Data is lost when the process exits. The ChatResult wrap returns ChatSuccess for every operation — no I/O means nothing to fail on.

Implemented types

Constructors

MemoryChatLocalDatasource()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addDeletedRoom(String roomId) Future<ChatResult<void>>
override
clear() Future<ChatResult<void>>
override
clearDeletedRoom(String roomId) Future<ChatResult<void>>
override
clearHiddenMessages(String roomId) Future<ChatResult<void>>
override
clearMessages(String roomId) Future<ChatResult<void>>
override
clearOfflineQueue() Future<ChatResult<void>>
override
clearPendingMessages(String roomId) Future<ChatResult<void>>
override
deleteMessage(String roomId, String messageId) Future<ChatResult<void>>
override
deletePendingMessage(String roomId, String messageId) Future<ChatResult<void>>
override
deletePin(String roomId, String messageId) Future<ChatResult<void>>
override
deleteReactions(String roomId, String messageId) Future<ChatResult<void>>
override
deleteRoom(String roomId) Future<ChatResult<void>>
override
deleteRoomDetail(String roomId) Future<ChatResult<void>>
override
deleteRoomMembers(String roomId) Future<ChatResult<void>>
override
deleteUnread(String roomId) Future<ChatResult<void>>
override
deleteUser(String userId) Future<ChatResult<void>>
override
dispose() Future<void>
Releases resources. Not wrapped in ChatResult — lifecycle errors at shutdown are non-actionable.
override
getClearedAt(String roomId) Future<ChatResult<DateTime?>>
override
getContacts() Future<ChatResult<List<ChatContact>>>
override
getDeletedRoomIds() Future<ChatResult<Set<String>>>
override
getHiddenMessageIds(String roomId) Future<ChatResult<Set<String>>>
override
getInvitedRooms() Future<ChatResult<List<InvitedRoom>>>
override
getKickedRoomIds() Future<ChatResult<Set<String>>>
override
getMessages(String roomId, {int? limit}) Future<ChatResult<List<ChatMessage>>>
override
getOfflineQueue() Future<ChatResult<List<Map<String, dynamic>>>>
override
getPendingMessages(String roomId) Future<ChatResult<List<PendingChatMessage>>>
override
getPins(String roomId) Future<ChatResult<List<MessagePin>>>
override
getReactions(String roomId, String messageId) Future<ChatResult<List<AggregatedReaction>>>
override
getReceipts(String roomId) Future<ChatResult<List<ReadReceipt>>>
override
getRoom(String roomId) Future<ChatResult<ChatRoom?>>
override
getRoomDetail(String roomId) Future<ChatResult<RoomDetail?>>
override
getRoomMembers(String roomId) Future<ChatResult<ChatPaginatedResponse<RoomUser>?>>
override
getRooms() Future<ChatResult<List<ChatRoom>>>
override
getUnreads() Future<ChatResult<List<UnreadRoom>>>
override
getUser(String userId) Future<ChatResult<ChatUser?>>
override
getUsers() Future<ChatResult<List<ChatUser>>>
override
hideMessageLocally(String roomId, String messageId) Future<ChatResult<void>>
"Delete for me" persistence: a per-room set of message IDs the user explicitly hid via messages.deleteLocally. The network list endpoint has no concept of per-user hiding, so without this set the tombstone (or the deleted message) re-appears every time the chat is re-opened. Default implementations are no-ops so non-persistent datasources (memory) keep working, at the cost of losing the hidden set on app restart.
override
loadCacheTimestamps() Future<Map<String, DateTime>>
override
markKicked(String roomId) Future<ChatResult<void>>
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reconcileUnreads(List<UnreadRoom> unreads) Future<ChatResult<void>>
Replaces the cached unread set with exactly unreads, removing any previously cached room absent from the new list. Use this for an authoritative type='all' room listing so rooms deleted or left on the server stop reappearing from cache (plain saveUnreads merges and never evicts). The default implementation diffs against getUnreads and deleteUnread; datasources with a native "replace box" primitive should override it for atomicity.
override
saveCacheTimestamps(Map<String, DateTime> timestamps) Future<void>
override
saveContacts(List<ChatContact> contacts) Future<ChatResult<void>>
override
saveInvitedRooms(List<InvitedRoom> invitedRooms) Future<ChatResult<void>>
override
saveMessages(String roomId, List<ChatMessage> messages) Future<ChatResult<void>>
override
saveOfflineQueue(List<Map<String, dynamic>> operations) Future<ChatResult<void>>
override
savePendingMessage(String roomId, ChatMessage message, {bool isFailed = false}) Future<ChatResult<void>>
override
savePins(String roomId, List<MessagePin> pins) Future<ChatResult<void>>
override
saveReactions(String roomId, String messageId, List<AggregatedReaction> reactions) Future<ChatResult<void>>
override
saveReceipts(String roomId, List<ReadReceipt> receipts) Future<ChatResult<void>>
override
saveRoomDetail(RoomDetail detail) Future<ChatResult<void>>
override
saveRoomMembers(String roomId, ChatPaginatedResponse<RoomUser> members) Future<ChatResult<void>>
Room member roster, as returned by an UNPAGINATED, UNEXPANDED members.list — the only shape MembersApi caches, so one record per room can never be served to a caller that asked for a different one. hasMore and totalCount travel with the items because a hit that invented them would break the paginator of a large group.
override
saveRooms(List<ChatRoom> rooms) Future<ChatResult<void>>
override
saveUnreads(List<UnreadRoom> unreads) Future<ChatResult<void>>
override
saveUsers(List<ChatUser> users) Future<ChatResult<void>>
override
setClearedAt(String roomId, DateTime timestamp) Future<ChatResult<void>>
override
toString() String
A string representation of this object.
inherited
unmarkKicked(String roomId) Future<ChatResult<void>>
override
updateMessage(String roomId, ChatMessage message) Future<ChatResult<void>>
override

Operators

operator ==(Object other) bool
The equality operator.
inherited