MessageCursorEvent: {
    cursor: number;
    messageId?: string;
    sourceEvent: SfuEvent;
    targetEntityId: MessageTargetEntityId;
    targetEntityType: MessageTargetEntityType;
    watermark?: boolean;
}

Journal seq of a live message change. Emitted for every message event that the server journals, regardless of whether the event resolved a pending promise or was notified to subscribers.

Not a server event type: SfuExtended derives it from the cursor field of the live events, which lets the cursor of an entity move between reconnects instead of freezing until the next MESSAGES_DIFFERENCE.

Type declaration

  • cursor: number

    Journal seq of the change, always >= 1 (events with cursor 0 are not emitted)

  • Optional messageId?: string

    Message the change belongs to, absent for a watermark: it stands for no single change

  • sourceEvent: SfuEvent

    Live event this cursor came from

  • targetEntityId: MessageTargetEntityId
  • targetEntityType: MessageTargetEntityType
  • Optional watermark?: boolean

    The server states that every journal record up to cursor meant for this client has already been sent, so the cursor may jump straight to it, see SfuEvent.MESSAGES_CURSOR_ADVANCED.

    Without it a cursor only ever moves to the record right after the local one: records numbered in between may be on their way rather than addressed to somebody else, and a client that jumped over an event it has not received yet would never ask for it again.