{"record":{"id":"78d04800ae906058","repo":"tinyhumansai/openhuman","slug":"integrationid-must-be-a-24-char-hex-id","errorCode":null,"errorMessage":"integrationId must be a 24-char hex id","messagePattern":"integrationId must be a 24-char hex id","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/api/rest.rs","lineNumber":879,"sourceCode":"        let integrations = value\n            .get(\"integrations\")\n            .cloned()\n            .unwrap_or_else(|| value.clone());\n        serde_json::from_value(integrations).context(\"parse integrations response\")\n    }\n\n    /// Fetches the decrypted OAuth tokens for a specific integration.\n    ///\n    /// This is a one-time handoff process. The encryption key must match the\n    /// one used by the backend to encrypt the tokens.\n    pub async fn fetch_integration_tokens_handoff(\n        &self,\n        integration_id: &str,\n        bearer_jwt: &str,\n        encryption_key: &str,\n    ) -> Result<IntegrationTokensHandoff> {\n        let id = integration_id.trim();\n        anyhow::ensure!(\n            !id.is_empty() && id.len() == 24,\n            \"integrationId must be a 24-char hex id\"\n        );\n        let body = serde_json::json!({ \"key\": encryption_key.trim() });\n        let value = self\n            .authed_json(\n                bearer_jwt,\n                Method::POST,\n                &format!(\"auth/integrations/{id}/tokens\"),\n                Some(body),\n            )\n            .await\n            .context(\"integration tokens handoff\")?;\n        let encrypted = value\n            .get(\"encrypted\")\n            .and_then(Value::as_str)\n            .context(\"integration tokens response missing encrypted payload\")?;\n        let plaintext = decrypt_handoff_blob(encrypted, encryption_key.trim())?;","sourceCodeStart":861,"sourceCodeEnd":897,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/api/rest.rs#L861-L897","documentation":"fetch_integration_tokens_handoff validates the integration id's shape before any request: it must be a 24-character hexadecimal string (a Mongo-style ObjectId), otherwise the backend handoff route would be unreachable with this id.","triggerScenarios":"Thrown at src/api/rest.rs:879 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the exact 24-hex-character integrationId returned by the integrations listing","Check for copied ids with truncation or extra characters"],"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"}