fix(channels): default channels to unencrypted so messages flow

Channels encrypt on egress and decrypt on ingress through the Encrypt/
Decrypt request brokers. Nothing in the production/FFI path registered a
provider, so every send failed at encryption before reaching the wire and
every receive failed at decryption before reassembly. The net effect was
that channel_send put nothing on the network and channel_message_received
never fired.

Install the pass-through noop provider in ReliableChannelManager.start(),
the symmetric spot to MessagingClient.start() wiring MessagingSend, on the
same FFI worker thread the channel handlers run on (the brokers are
thread-local). setProvider refuses to overwrite, so an application that
installs its own encryption before start keeps it; otherwise channels
default to unencrypted payloads.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Ivan FB 2026-07-17 18:07:31 +02:00
parent ce918b0819
commit 98883edb92
No known key found for this signature in database
GPG Key ID: DF0C67A04C543270

View File

@ -18,6 +18,7 @@ import logos_delivery/api/reliable_channel_manager_api
import logos_delivery/api/conf/channels_conf
import ./reliable_channel
import ./encryption/noop_encryption
export reliable_channel, channels_conf
@ -40,10 +41,15 @@ proc new*(
)
proc start*(self: ReliableChannelManager): Result[void, string] =
## Placeholder: per-channel listeners are installed in `ReliableChannel.new`,
## so the manager has nothing to start at this layer. Kept for symmetry
## with the `Waku` mount/start lifecycle and as a hook for future state.
discard
## Per-channel listeners are installed in `ReliableChannel.new`, so the only
## thing to wire up here is the encryption brokers. Channels encrypt on egress
## and decrypt on ingress via the `Encrypt`/`Decrypt` request brokers; with no
## provider registered every send and receive would fail, so `channel_send`
## would never reach the wire and `ChannelMessageReceivedEvent` would never
## fire. Install the pass-through noop so channels default to unencrypted
## payloads. `setProvider` refuses to overwrite, so an application that
## installed its own encryption before start keeps it.
setNoopEncryption()
ok()
proc stop*(self: ReliableChannelManager) {.async.} =