mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-07-05 17:32:10 +02:00
Fix dupe packet test
This commit is contained in:
+19
-2
@@ -92,7 +92,7 @@ async def create_message_from_decrypted(
|
||||
"txt_type": 0,
|
||||
"signature": None,
|
||||
"outgoing": False,
|
||||
"acked": False,
|
||||
"acked": 0,
|
||||
})
|
||||
|
||||
return msg_id
|
||||
@@ -131,6 +131,23 @@ async def process_raw_packet(
|
||||
|
||||
packet_id = await RawPacketRepository.create(raw_bytes, ts)
|
||||
|
||||
# If packet_id is None, this is a duplicate packet (same data already exists)
|
||||
# Skip processing since we've already handled this exact packet
|
||||
if packet_id is None:
|
||||
logger.debug("Duplicate raw packet detected, skipping")
|
||||
return {
|
||||
"packet_id": None,
|
||||
"timestamp": ts,
|
||||
"raw_hex": raw_bytes.hex(),
|
||||
"payload_type": "Duplicate",
|
||||
"snr": snr,
|
||||
"rssi": rssi,
|
||||
"decrypted": False,
|
||||
"message_id": None,
|
||||
"channel_name": None,
|
||||
"sender": None,
|
||||
}
|
||||
|
||||
raw_hex = raw_bytes.hex()
|
||||
|
||||
# Parse packet to get type
|
||||
@@ -295,7 +312,7 @@ async def _process_group_text(
|
||||
"txt_type": 0,
|
||||
"signature": None,
|
||||
"outgoing": False,
|
||||
"acked": False,
|
||||
"acked": 0,
|
||||
})
|
||||
|
||||
# Mark the raw packet as decrypted
|
||||
|
||||
Reference in New Issue
Block a user