fix: Clear packet database alongside node database (#3634)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2025-11-06 14:16:59 -06:00 committed by GitHub
parent 6d1f49f6bc
commit 421e35a19c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 1 deletions

View file

@ -1990,6 +1990,9 @@ class MeshService : Service() {
Timber.d("Clearing nodeDB")
discardNodeDB()
nodeRepository.clearNodeDB()
Timber.d("Clearing packetDB")
packetRepository.get().clearPacketDB()
}
private fun updateLastAddress(deviceAddr: String?) {

View file

@ -249,8 +249,21 @@ interface PacketDao {
@Upsert suspend fun insert(reaction: ReactionEntity)
@Transaction
suspend fun deleteAll() {
deleteAllPackets()
deleteAllReactions()
deleteAllContactSettings()
}
@Query("DELETE FROM packet")
suspend fun deleteAll()
suspend fun deleteAllPackets()
@Query("DELETE FROM reactions")
suspend fun deleteAllReactions()
@Query("DELETE FROM contact_settings")
suspend fun deleteAllContactSettings()
/**
* One-time migration: Remap all message DataPacket.channel indices to new mapping using PSK after a channel