mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix: replace duplicate packet IDs before sending queue (#646)
This commit is contained in:
parent
9970ced53b
commit
bb3b1eaa85
3 changed files with 17 additions and 0 deletions
|
|
@ -850,6 +850,13 @@ class MeshService : Service(), Logging {
|
|||
|
||||
private fun processQueuedPackets() = serviceScope.handledLaunch {
|
||||
packetRepository.get().getQueuedPackets()?.forEach { p ->
|
||||
// check for duplicate packet IDs before sending (so ACK/NAK updates can work)
|
||||
if (getDataPacketById(p.id)?.time != p.time) {
|
||||
val newId = generatePacketId()
|
||||
debug("Replaced duplicate packet ID in queue: ${p.id}, with: $newId")
|
||||
packetRepository.get().updateMessageId(p, newId)
|
||||
p.id = newId
|
||||
}
|
||||
try {
|
||||
sendNow(p)
|
||||
} catch (ex: Exception) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue