merge

suspend fun merge(source: MeshtasticDatabase, dest: MeshtasticDatabase, sourceName: String, isAssociationActive: () -> Boolean = { true })(source)

Folds source into dest, skipping the work if sourceName was already merged into dest. sourceName is the source database's file name — the stable key under which the merge is recorded (see MergeMarkerEntity).

The caller owns the transport-session lifecycle lease through this method's return. That lease makes transaction commit and session rollover mutually exclusive; isAssociationActive remains a defensive check for authority lost before the merge entered its commit phase.