mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-06 16:53:38 +02:00
Docs improvements
This commit is contained in:
+2
-2
@@ -140,8 +140,8 @@ app/
|
||||
|
||||
### Echo/repeat dedup
|
||||
|
||||
- Channel message uniqueness: `(type, conversation_key, text, sender_timestamp)`.
|
||||
- Incoming PRIV message uniqueness: `(type, conversation_key, text, COALESCE(sender_timestamp, 0), COALESCE(sender_key, ''))` — `sender_key` was added in migration 056 to distinguish room-server posts from different senders in the same second.
|
||||
- Channel message uniqueness (`idx_messages_dedup_null_safe`): `(type, conversation_key, text, COALESCE(sender_timestamp, 0))` where `type = 'CHAN'`.
|
||||
- Incoming PRIV message uniqueness (`idx_messages_incoming_priv_dedup`): `(type, conversation_key, text, COALESCE(sender_timestamp, 0), COALESCE(sender_key, ''))` where `type = 'PRIV' AND outgoing = 0` — `sender_key` was added in migration 056 to distinguish room-server posts from different senders in the same second.
|
||||
- Duplicate insert is treated as an echo/repeat: the new path (if any) is appended, and the ACK count is incremented only for outgoing channel messages. Incoming direct messages with the same dedup identity also collapse onto one stored row, with later observations merging path data instead of creating a second DM.
|
||||
|
||||
### Raw packet dedup policy
|
||||
|
||||
@@ -237,9 +237,13 @@ async def on_new_contact(event: "Event") -> None:
|
||||
logger.debug("New contact: %s", public_key[:12])
|
||||
|
||||
contact_upsert = ContactUpsert.from_radio_dict(public_key.lower(), payload, on_radio=False)
|
||||
# Intentionally do not set last_seen here: NEW_CONTACT fires from the
|
||||
# radio's stored contact DB, not an RF observation. last_seen means
|
||||
# "last time we heard this pubkey on RF".
|
||||
# Intentionally do not set first_seen or last_seen here: NEW_CONTACT
|
||||
# fires from the radio's stored contact DB, not an RF observation.
|
||||
# Both first_seen and last_seen are RF-only timestamps — they track
|
||||
# the first and most recent time we actually heard this pubkey over
|
||||
# the air (adverts, messages, path updates). Contacts synced from the
|
||||
# radio's internal DB without any RF activity stay NULL until a real
|
||||
# RF observation fills them in.
|
||||
await ContactRepository.upsert(contact_upsert)
|
||||
promoted_keys = await promote_prefix_contacts_for_contact(
|
||||
public_key=public_key,
|
||||
|
||||
Reference in New Issue
Block a user