Update sds/protobuf.nim

Co-authored-by: Esteban C Borsani <ecastroborsani@gmail.com>
This commit is contained in:
Ivan FB 2026-06-11 17:33:22 +02:00 committed by GitHub
parent b970e49570
commit a39a1dea1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -139,7 +139,10 @@ proc deserializeMessage*(data: seq[byte]): Result[SdsMessage, ReliabilityError]
let msg = Protobuf.decode(data, SdsMessagePB).fromPB
if msg.messageId.len == 0 or msg.channelId.len == 0:
return err(ReliabilityError.reDeserializationError)
for e in msg.causalHistory & msg.repairRequest:
for e in msg.causalHistory:
if e.messageId.len == 0:
return err(ReliabilityError.reDeserializationError)
for e in msg.repairRequest:
if e.messageId.len == 0:
return err(ReliabilityError.reDeserializationError)
return ok(msg)