Overview
Returns an async function that marks a conversation as read up to a specific message. The unread count for the conversation is cleared in Redux immediately (optimistic update). The server is then notified to advance the user’slastReadAt timestamp.
Requires
ChatProvider in the component tree.Usage Example
Props
The ID of the conversation to mark as read.
Parameters
The hook returns a function. That function accepts:The ID of the message to mark as read up to. The server sets
lastReadAt to this message’s createdAt.Returns
Promise<void>
Notes
- The failure to mark as read on the server (e.g. network error) is non-critical. The local Redux count is already cleared and will re-sync on the next
ChatProvidermount. - For integration guidance, see Chat: Real-time.

