Fix WASM channel on-status instantiation failure and HTTP port conflict

Consolidate channel sources into channels-src/ by moving whatsapp from
channels/. Add on_status stubs to Slack and WhatsApp so their WASM
binaries export the function added in the latest WIT. Fix Slack's
emit_message call to pass by reference (API changed). Guard WASM webhook
server startup to skip when the HTTP channel already occupies port 8080.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
Illia Polosukhin
2026-02-06 10:01:26 -08:00
co-authored by Claude Opus 4.6
parent 4d0fe7d37e
commit 8439293df3
7 changed files with 512 additions and 5 deletions
+8 -2
View File
@@ -618,8 +618,14 @@ async fn main() -> anyhow::Result<()> {
channels.add(Box::new(SharedWasmChannel::new(channel_arc)));
}
// Start WASM channel webhook server if we have channels with webhooks
if has_webhook_channels && config.tunnel.public_url.is_some() {
// Start WASM channel webhook server if we have channels with webhooks.
// Skip when the HTTP channel already occupies port 8080.
let http_uses_port =
config.channels.http.as_ref().map(|h| h.port) == Some(8080);
if has_webhook_channels
&& config.tunnel.public_url.is_some()
&& !http_uses_port
{
let mut server = WasmChannelServer::new(wasm_router);
if let Some(ref ext_mgr) = extension_manager {
server = server.with_extension_manager(Arc::clone(ext_mgr));