14 Commits

Author SHA1 Message Date
Ivan FB
e44daec1c4
nph fix 2026-05-29 21:41:30 +02:00
Ivan FB
f1f02302f0
remove proc getChannelForTest proc 2026-05-29 15:17:04 +02:00
Ivan FB
2f9d9336cc
introduce ChannelMessageSentEven and ChannelMessageErrorEvent 2026-05-29 15:05:20 +02:00
Ivan FB
4d90c1190a
use sendHandler in reliable channel 2026-05-29 13:08:56 +02:00
Ivan FB
9976fe3d07
use ref object for large events to avoid expensive deep copies 2026-05-29 11:30:24 +02:00
Ivan FB
ad0fe71bbf
rm comment 2026-05-29 11:01:14 +02:00
Ivan FB
20c71c6929
defer pruneCompletedChannelReqs until after onReadyToSend's index walk
Reviewer flagged that prune was mutating pendingMessagingRequests under
index iteration. Concrete failure: if prune drops the entry at the
current idx, the seq shifts and `idx.inc()` skips the next slot.

Hoist the single prune call to after the outer loop. Prune is idempotent
on the final-state filter, so doing it once at the end is equivalent to
calling it per-error-path while keeping idx aligned.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 11:00:00 +02:00
Ivan FB
3f1a45c73c
route reliable channel send through waku.send
Reviewer flagged that constructing MessageEnvelope/DeliveryTask, minting
the messagingReqId, poking deliveryTask.msg.meta, and calling
sendService.send directly all reach past the messaging API into its
internals — a layer-boundary violation.

Replace that block in onReadyToSend with `await self.waku.send(envelope)`
where `envelope.meta` carries the wire-format marker. The channel now
holds a `Waku` instead of a `DeliveryService`. waku.send already handles
requestId generation, subscription, and DeliveryTask construction.

`waku.send` isn't `(raises: [])` so the await is wrapped in try/except to
keep the listener annotation honest.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 10:27:30 +02:00
Ivan FB
e59b35b2e0
mark onReadyToSend msgs as sink to signal consume semantics
PR review noted that an async proc captures parameters into the future's
env, deep-copying `seq[seq[byte]]`. `sink` tells the compiler the callee
consumes msgs, letting it move under arc/orc memory models. Under refc
the change is a no-op but documents intent at the boundary.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 09:52:30 +02:00
Ivan FB
95f56e653e
fix logic issue added recently 2026-05-29 09:06:07 +02:00
Ivan FB
41a43174be
use applyItIf in reliable_channel 2026-05-29 08:49:53 +02:00
Ivan FB
ec6a02db7c
Update channels/reliable_channel.nim
Co-authored-by: NagyZoltanPeter <113987313+NagyZoltanPeter@users.noreply.github.com>
2026-05-29 08:37:36 +02:00
Ivan FB
1926b86d06
better pending segments management 2026-05-28 10:39:48 +02:00
Ivan FB
74057c6622
start basic reliable channel folder (#3886) 2026-05-27 23:05:20 +02:00