Follow-up to #383, raised in review of #400.
A JS host that serves the chat capability can create rooms, post messages and serve the room list, but cannot deliver an incoming message to a product.
ChatConnection::publish_action is #[cfg(any(test, not(target_arch = "wasm32")))] (runtime/chat.rs:63) and its only non-test caller is NativeProductExecution::publish_chat_action (native.rs:796), inside the native module, which is itself #[cfg(not(target_arch = "wasm32"))] (lib.rs:40). So nothing in a wasm build can publish a chat action.
The product-visible effect: Chat/action_subscribe returns a subscription that yields nothing and never ends, which a product cannot distinguish from a quiet room. Custom-message rendering is native-only for the same reason.
Serving chat products from Polkadot Desktop needs an inbound path — a way for a JS host to publish actions into the product's connection, and a wasm-reachable renderer path.
Follow-up to #383, raised in review of #400.
A JS host that serves the
chatcapability can create rooms, post messages and serve the room list, but cannot deliver an incoming message to a product.ChatConnection::publish_actionis#[cfg(any(test, not(target_arch = "wasm32")))](runtime/chat.rs:63) and its only non-test caller isNativeProductExecution::publish_chat_action(native.rs:796), inside thenativemodule, which is itself#[cfg(not(target_arch = "wasm32"))](lib.rs:40). So nothing in a wasm build can publish a chat action.The product-visible effect:
Chat/action_subscribereturns a subscription that yields nothing and never ends, which a product cannot distinguish from a quiet room. Custom-message rendering is native-only for the same reason.Serving chat products from Polkadot Desktop needs an inbound path — a way for a JS host to publish actions into the product's connection, and a wasm-reachable renderer path.