mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-02 14:03:06 +00:00
fix: filter out ephemeral msg from waku sync (#3332)
This commit is contained in:
parent
7dbc1fe061
commit
cda48e25f7
@ -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",
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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])
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user