function markChatRead
markChatRead(
userId: string,
at: string
): ChatReadState

Moves userId's read marker to at, a message's created_at, on a chat_read. It never moves back, so a lagging tab can't undo a newer tab's read. It never passes the newest message, so a timestamp from the future can't mark messages read before they are sent.

Parameters

userId: string
at: string

Return Type

Throws

APIException

400 when at isn't a date, 404 when there is no such user.

Usage

import { markChatRead } from "api/services/chat-service.ts";