Decrypted should take precedence #129

Closed
opened 2026-10-04 23:01:34 +02:00 by adam · 0 comments
Owner

Encrypted JSON:

[{"id":3189171433,"rx_time":1767957187,"rx_iso":"2026-01-09T11:19:45Z","from_id":"!7c5b0920","to_id":"^all","channel":3,"encrypted":"otu3OyMrTIUlcaisLVDyAnLW","rssi":-117,"hop_limit":7,"lora_freq":868,"modem_preset":"MediumFast","channel_name":"PUBLIC","snr":-14.0,"node_id":"!7c5b0920"},
{"id":4126217817,"rx_time":1767957159,"rx_iso":"2026-01-09T11:19:16Z","from_id":"!1d60dd3c","to_id":"^all","channel":3,"encrypted":"Xso0VQhndJ5RJ3pfHRVRLKSA","rssi":-112,"hop_limit":7,"lora_freq":868,"modem_preset":"MediumFast","channel_name":"PUBLIC","snr":-8.25,"node_id":"!1d60dd3c"}]

Decrypted JSON:

[{"id":3189171433,"rx_time":1767957191,"rx_iso":"2026-01-09T11:13:11Z","from_id":"!7c5b0920","to_id":"^all","channel":7,"portnum":"TEXT_MESSAGE_APP","text":"FF-TB Beacon","rssi":-79,"hop_limit":5,"lora_freq":868,"modem_preset":"MediumFast","channel_name":"PUBLIC","snr":9.75,"node_id":"!7c5b0920"}
,{"id":4126217817,"rx_time":1767957160,"rx_iso":"2026-01-09T11:12:40Z","from_id":"!1d60dd3c","to_id":"^all","channel":7,"portnum":"TEXT_MESSAGE_APP","text":"FF-ZW Beacon","rssi":-85,"hop_limit":5,"lora_freq":868,"modem_preset":"MediumFast","channel_name":"PUBLIC","snr":-15.0,"node_id":"!1d60dd3c"}]

If we have the message already, check if we have a decrypted or encrypted. If the database has encrypted only but we received a decrypted version, update the message record with the decrypted version. Do not update decrypted messages with encrypted payloads.

Encrypted JSON: ```json [{"id":3189171433,"rx_time":1767957187,"rx_iso":"2026-01-09T11:19:45Z","from_id":"!7c5b0920","to_id":"^all","channel":3,"encrypted":"otu3OyMrTIUlcaisLVDyAnLW","rssi":-117,"hop_limit":7,"lora_freq":868,"modem_preset":"MediumFast","channel_name":"PUBLIC","snr":-14.0,"node_id":"!7c5b0920"}, {"id":4126217817,"rx_time":1767957159,"rx_iso":"2026-01-09T11:19:16Z","from_id":"!1d60dd3c","to_id":"^all","channel":3,"encrypted":"Xso0VQhndJ5RJ3pfHRVRLKSA","rssi":-112,"hop_limit":7,"lora_freq":868,"modem_preset":"MediumFast","channel_name":"PUBLIC","snr":-8.25,"node_id":"!1d60dd3c"}] ``` Decrypted JSON: ```json [{"id":3189171433,"rx_time":1767957191,"rx_iso":"2026-01-09T11:13:11Z","from_id":"!7c5b0920","to_id":"^all","channel":7,"portnum":"TEXT_MESSAGE_APP","text":"FF-TB Beacon","rssi":-79,"hop_limit":5,"lora_freq":868,"modem_preset":"MediumFast","channel_name":"PUBLIC","snr":9.75,"node_id":"!7c5b0920"} ,{"id":4126217817,"rx_time":1767957160,"rx_iso":"2026-01-09T11:12:40Z","from_id":"!1d60dd3c","to_id":"^all","channel":7,"portnum":"TEXT_MESSAGE_APP","text":"FF-ZW Beacon","rssi":-85,"hop_limit":5,"lora_freq":868,"modem_preset":"MediumFast","channel_name":"PUBLIC","snr":-15.0,"node_id":"!1d60dd3c"}] ``` If we have the message already, check if we have a decrypted or encrypted. If the database has encrypted only but we received a decrypted version, update the message record with the decrypted version. Do not update decrypted messages with encrypted payloads. <!-- github-sync-id:3796585535 -->
adam closed this issue 2026-10-04 23:01:34 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/potato-mesh#129