From a1c95abf86e2e395f2f57b889f0bbdbb22c1a594 Mon Sep 17 00:00:00 2001 From: Jack Kingsman Date: Tue, 10 Feb 2026 21:15:26 -0800 Subject: [PATCH] Add comments around edge cases as non-issues --- app/database.py | 4 ++++ app/routers/messages.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/app/database.py b/app/database.py index f85ad6e..23a2e3d 100644 --- a/app/database.py +++ b/app/database.py @@ -42,6 +42,10 @@ CREATE TABLE IF NOT EXISTS messages ( signature TEXT, outgoing INTEGER DEFAULT 0, acked INTEGER DEFAULT 0, + -- Deduplication: identical text + timestamp in the same conversation is treated as a + -- mesh echo/repeat. Second-precision timestamps mean two intentional identical messages + -- within the same second would collide, but this is not feasible in practice — LoRa + -- transmission takes several seconds per message, and the UI clears the input on send. UNIQUE(type, conversation_key, text, sender_timestamp) ); diff --git a/app/routers/messages.py b/app/routers/messages.py index 30a6753..22ffbd5 100644 --- a/app/routers/messages.py +++ b/app/routers/messages.py @@ -236,6 +236,9 @@ async def send_channel_message(request: SendChannelMessageRequest) -> Message: detail="Failed to store outgoing message - unexpected duplicate", ) + # Experimental: byte-perfect resend after a delay to improve delivery reliability. + # This intentionally holds the radio operation lock for the full delay — it is an + # opt-in experimental feature where blocking other radio operations is acceptable. if app_settings.experimental_channel_double_send: logger.debug( "Experimental channel double-send enabled; waiting %ds before byte-perfect duplicate",