RemoteBackupChangeLogDAO

Data Access Object for tracking changes that need to be synced to remote backup. This changelog tracks WHAT changed, not the data itself. Actual data is fetched from existing DB tables when syncing.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun deleteChanges(changes: List<ChangeLogEntry>)

Delete the given changelog changes after they were successfully synced.

Link copied to clipboard
abstract suspend fun getLastPendingChangesBatch(limit: Long): ChangeLogSyncBatch

Get a transactional snapshot of the latest limit pending changes and their conversations' last-read timestamps.

Link copied to clipboard
abstract suspend fun getPendingChanges(): List<ChangeLogEntry>

Get all pending changes ordered deterministically for replay.

Link copied to clipboard
abstract suspend fun logConversationClear(conversationId: QualifiedIDEntity, timestampMs: Long)

Log a conversation clear event. This clears all existing entries for the conversation and adds a single clear event.

Link copied to clipboard
abstract suspend fun logConversationDelete(conversationId: QualifiedIDEntity, timestampMs: Long)

Log a conversation deletion event. This clears all existing entries for the conversation and adds a single delete event.

Link copied to clipboard
abstract suspend fun logMessageDelete(conversationId: QualifiedIDEntity, messageId: String, timestampMs: Long)

Log a message deletion event.

Link copied to clipboard
abstract suspend fun logMessageUpsert(conversationId: QualifiedIDEntity, messageId: String, timestampMs: Long, messageTimestampMs: Long = timestampMs)

Log a message upsert (create or edit) event.

Link copied to clipboard
abstract suspend fun logReactionsSync(conversationId: QualifiedIDEntity, messageId: String, timestampMs: Long)

Log a reactions sync event. This means "sync all reactions for this message" - when any reaction changes.

Link copied to clipboard
abstract suspend fun logReadReceiptsSync(conversationId: QualifiedIDEntity, messageId: String, timestampMs: Long)

Log a read receipts sync event. This means "sync all read receipts for this message" - when any receipt changes.

Link copied to clipboard
abstract fun observeLastPendingChangesBatch(limit: Long): <Error class: unknown class><ChangeLogSyncBatch>

Observe transactional snapshots of the latest limit pending changes and their conversations' last-read timestamps.