mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-06-30 13:29:37 +00:00
messaging: fix send-processor chain after conflict resolution
A merge conflict left setupSendProcessorChain half-migrated: the body referenced a `waku` that was not a parameter and the caller used a `w` that no longer existed, so the send service did not compile. Restore the kernel-routed form: take the Waku kernel, build the relay handler via waku.relayPushHandler(), and drop the now-unused WakuNode internals. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
ab05e31cc0
commit
5e6be10c8e
@ -7,16 +7,7 @@ import chronos, chronicles, libp2p/utility
|
||||
import brokers/broker_context
|
||||
import
|
||||
./[send_processor, relay_processor, lightpush_processor, delivery_task],
|
||||
logos_delivery/waku/[
|
||||
waku_core,
|
||||
node/waku_node,
|
||||
node/peer_manager,
|
||||
waku_store/common,
|
||||
waku_relay/protocol,
|
||||
rln/rln,
|
||||
waku_lightpush/client,
|
||||
waku_lightpush/callbacks,
|
||||
],
|
||||
logos_delivery/waku/[waku_core, waku_store/common],
|
||||
logos_delivery/waku/waku,
|
||||
logos_delivery/waku/api/[store, subscriptions, publish]
|
||||
import logos_delivery/api/messaging_client_api
|
||||
@ -62,11 +53,7 @@ type SendService* = ref object of RootObj
|
||||
lastStoreCheckTime: Moment ## throttles store validation queries to ArchiveTime cadence
|
||||
|
||||
proc setupSendProcessorChain(
|
||||
peerManager: PeerManager,
|
||||
lightpushClient: WakuLightPushClient,
|
||||
relay: WakuRelay,
|
||||
rlnRelay: Rln,
|
||||
brokerCtx: BrokerContext,
|
||||
waku: Waku, brokerCtx: BrokerContext
|
||||
): Result[BaseSendProcessor, string] =
|
||||
let isRelayAvail = waku.hasRelay()
|
||||
let isLightPushAvail = waku.hasLightpush()
|
||||
@ -77,13 +64,7 @@ proc setupSendProcessorChain(
|
||||
var processors = newSeq[BaseSendProcessor]()
|
||||
|
||||
if isRelayAvail:
|
||||
let rln: Option[Rln] =
|
||||
if rlnRelay.isNil():
|
||||
none[Rln]()
|
||||
else:
|
||||
some(rlnRelay)
|
||||
let publishProc = getRelayPushHandler(relay, rln)
|
||||
|
||||
let publishProc = waku.relayPushHandler()
|
||||
processors.add(RelaySendProcessor.new(isLightPushAvail, publishProc, brokerCtx))
|
||||
if isLightPushAvail:
|
||||
processors.add(LightpushSendProcessor.new(waku, brokerCtx))
|
||||
@ -106,9 +87,7 @@ proc new*(
|
||||
|
||||
let checkStoreForMessages = preferP2PReliability and waku.isStoreMounted()
|
||||
|
||||
let sendProcessorChain = setupSendProcessorChain(
|
||||
w.peerManager, w.wakuLightPushClient, w.wakuRelay, w.rln, w.brokerCtx
|
||||
).valueOr:
|
||||
let sendProcessorChain = setupSendProcessorChain(waku, waku.brokerCtx).valueOr:
|
||||
return err("failed to setup SendProcessorChain: " & $error)
|
||||
|
||||
let sendService = SendService(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user