NotificationEventStore

class NotificationEventStore(database: UserDatabase, readDispatcher: ReadDispatcher, writeDispatcher: WriteDispatcher)

Stores complete REST pages and their fetch cursor in one SQLite transaction.

Constructors

Link copied to clipboard
internal constructor(database: UserDatabase, readDispatcher: ReadDispatcher, writeDispatcher: WriteDispatcher)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend fun cursor(): String?
Link copied to clipboard
suspend fun defer(eventId: String, untilEpochMillis: Long)

A scheduling hint only. The original event remains the source of truth.

Link copied to clipboard
suspend fun deferredUntil(eventId: String): Long?
Link copied to clipboard
suspend fun markProcessed(eventIds: List<String>, metadataKeysByEvent: Map<String, List<String>>)

Acknowledge received events and retire their operation records in the same SQL commit.

Link copied to clipboard
suspend fun nextPending(): EventEntity?
Link copied to clipboard
suspend fun nextPendingAfter(afterId: Long): EventEntity?

Scan past deferred rows without acknowledging them or moving the fetch cursor.

Link copied to clipboard
suspend fun pendingAfter(afterId: Long, pageSize: Long = 100): List<EventEntity>

Read-only terminal-account preflight; never advances the processing cursor.

Link copied to clipboard
suspend fun storePage(expectedCursor: String?, events: List<NewEventEntity>)