{"record":{"id":"779bb276bb6d3cdd","repo":"tinyhumansai/openhuman","slug":"channel-is-required","errorCode":null,"errorMessage":"channel is required","messagePattern":"channel is required","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/api/rest.rs","lineNumber":555,"sourceCode":"            .to_string();\n        anyhow::ensure!(!jwt.is_empty(), \"consume login token response missing jwt\");\n        Ok(jwt)\n    }\n\n    /// Validates that the provided session token is still active and accepted.\n    pub async fn validate_session_token(&self, bearer_jwt: &str) -> Result<()> {\n        let _ = self.fetch_current_user(bearer_jwt).await?;\n        Ok(())\n    }\n\n    /// Creates a short-lived link token for connecting a specific communication channel.\n    pub async fn create_channel_link_token(\n        &self,\n        channel: &str,\n        bearer_jwt: &str,\n    ) -> Result<Value> {\n        let channel = channel.trim().trim_matches('/');\n        anyhow::ensure!(!channel.is_empty(), \"channel is required\");\n        let encoded_channel = urlencoding::encode(channel);\n\n        self.authed_json(\n            bearer_jwt,\n            Method::POST,\n            &format!(\"auth/channels/{encoded_channel}/link-token\"),\n            None,\n        )\n        .await\n    }\n\n    /// Generic authenticated JSON request helper for backend API routes.\n    pub async fn authed_json(\n        &self,\n        bearer_jwt: &str,\n        method: Method,\n        path: &str,\n        body: Option<Value>,","sourceCodeStart":537,"sourceCodeEnd":573,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/api/rest.rs#L537-L573","documentation":"create_channel_link_token trims the channel identifier (including surrounding slashes) and found it empty, so the backend route cannot be addressed and the call is rejected before any request is sent.","triggerScenarios":"Thrown at src/api/rest.rs:555 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the channel name, e.g. 'telegram' or 'discord'","Check that the channel argument was not omitted or reduced to slashes"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}