fix: filter out ephemeral msg from waku sync (#3332)

This commit is contained in:
Simon-Pierre Vivier 2025-03-20 15:30:29 -04:00 committed by GitHub
parent 7dbc1fe061
commit cda48e25f7
3 changed files with 13 additions and 0 deletions

View File

@ -132,6 +132,9 @@ proc syncMessageIngress*(
pubsubTopic: PubsubTopic,
msg: WakuMessage,
): Future[Result[void, string]] {.async.} =
if msg.ephemeral:
return err("ephemeral message, will not store")
let msgHashHex = msgHash.to0xHex()
trace "handling message in syncMessageIngress",

View File

@ -68,6 +68,9 @@ type SyncReconciliation* = ref object of LPProtocol
proc messageIngress*(
self: SyncReconciliation, pubsubTopic: PubsubTopic, msg: WakuMessage
) =
if msg.ephemeral:
return
let msgHash = computeMessageHash(pubsubTopic, msg)
let id = SyncID(time: msg.timestamp, hash: msgHash)
@ -78,6 +81,9 @@ proc messageIngress*(
proc messageIngress*(
self: SyncReconciliation, msgHash: WakuMessageHash, msg: WakuMessage
) =
if msg.ephemeral:
return
let id = SyncID(time: msg.timestamp, hash: msgHash)
self.storage.insert(id).isOkOr:

View File

@ -118,6 +118,10 @@ proc needsReceiverLoop(self: SyncTransfer) {.async.} =
error "failed to query archive", error = error
continue
if response.messages.len < 1:
error "failed to fetch message from db"
continue
let msg =
WakuMessageAndTopic(pubsub: response.topics[0], message: response.messages[0])