fix(meshcore): cross-feeder channel_text dedup (#387)#389
Merged
Conversation
Centralize wire pkt_hash, channel_text content hash, and envelope surrogate fallback for cross-feeder dedup (#387).
Resolve channel before lookup, store computed or wire key in pkt_hash, and match duplicates via dedup_key (#387).
HTTP ingest from two feeders yields one packet, two observations, one TextMessage, and heard length 2 (#387).
Document content-hash keys, cross-feeder behaviour, and #387 tracking.
9eb2014 to
8a80c25
Compare
Surrogate and content hashes used the full 64-bit digest, which overflows Postgres BIGINT on advert/raw ingest. Share digest_to_signed_bigint across dedup paths (#387).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements cross-feeder dedup for MeshCore
channel_textingest (#387).When two feeders hear the same on-air channel post (no wire
pkt_hashonchannel_message), the API now creates oneMeshCoreTextPacket, NMeshCorePacketObservationrows, and oneTextMessage— matching Meshtastic multi-feeder behaviour. Heard API returns all feeders (len(heard) == 2).Dedup key resolution (
dedup_key.py):pkt_hashwhen present (e.g.rx_log_data, future TEXT_MSG upload per #385).channel_text: content hash over constellation + canonicalMessageChannel.id+sender_timestamp+ strippedtext.Fix: ingest now persists the resolved key on
MeshCoreRawPacket.pkt_hash(previously lookup used a surrogate but create storednull).No DB migration; historical duplicate
TextMessagerows are not backfilled. No bot changes required for MVP.Land this before or rebase #386 (path twin) if both are open.
Closes #387
Testing performed
python -m pytest Meshflow/meshcore_packets/tests/test_dedup_key.py Meshflow/meshcore_packets/tests/test_cross_feeder_dedup.py Meshflow/meshcore_packets/tests/test_ingest.py Meshflow/meshcore_packets/tests/test_canonical_channels.py -vmeshcore.md,text-message-channels.md,phase-3-outstanding.mdPost-deploy (pre-prod)
TextMessage,obs_count >= 2, non-nullpkt_hashon new ingests.