fix: prevent duplicate WASM channel activation on startup (#390)

Register boot-loaded WASM channel names with the extension manager via
set_active_channels() before set_channel_runtime() so the dedup guard
in activate_wasm_channel() is armed before the activation path becomes
available. This fixes 409 Conflict errors from the Telegram API caused
by two concurrent getUpdates polling loops.

Also fix pre-existing clippy warning in signal.rs test.

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
Henry Park
2026-02-27 07:54:01 +04:00
committed by GitHub
co-authored by Claude Opus 4.6
parent bf35b59222
commit e8eb4ca0bd
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -2742,7 +2742,7 @@ mod tests {
let ctx = ch.conversation_context(&metadata);
assert_eq!(ctx.get("sender"), Some(&"+1234567890".to_string()));
assert_eq!(ctx.get("sender_uuid"), Some(&"uuid-123".to_string()));
assert!(ctx.get("group").is_none());
assert!(!ctx.contains_key("group"));
}
#[test]
+1
View File
@@ -602,6 +602,7 @@ async fn main() -> anyhow::Result<()> {
if let Some(ref ext_mgr) = components.extension_manager
&& let Some((rt, ps, router)) = wasm_channel_runtime_state.take()
{
ext_mgr.set_active_channels(loaded_wasm_channel_names).await;
ext_mgr
.set_channel_runtime(
Arc::clone(&channels),