{"record":{"id":"ce7037d4e67f4d8d","repo":"BigPizzaV3/CodexPlusPlus","slug":"session-file-import-is-unavailable","errorCode":null,"errorMessage":"Session file import is unavailable","messagePattern":"Session file import is unavailable","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/routes.rs","lineNumber":126,"sourceCode":"\n#[async_trait]\npub trait BridgeDataService: Send + Sync {\n    async fn delete(&self, session: SessionRef) -> anyhow::Result<DeleteResult>;\n    async fn undo(&self, undo_token: String) -> anyhow::Result<DeleteResult>;\n    async fn export_markdown(&self, session: SessionRef) -> anyhow::Result<ExportResult>;\n    async fn thread_usage_history(&self, session: SessionRef) -> anyhow::Result<Value>;\n    async fn find_archived_thread_by_title(\n        &self,\n        title: String,\n    ) -> anyhow::Result<Option<SessionRef>>;\n    async fn recover_remote_control_session(&self, _thread_id: String) -> anyhow::Result<Value> {\n        anyhow::bail!(\"Remote Control session recovery is unavailable\")\n    }\n    async fn export_session_file(&self, _session: SessionRef) -> anyhow::Result<Value> {\n        anyhow::bail!(\"Session file export is unavailable\")\n    }\n    async fn import_session_file(&self, _payload: Value) -> anyhow::Result<Value> {\n        anyhow::bail!(\"Session file import is unavailable\")\n    }\n}\n\npub async fn handle_bridge_request(\n    ctx: BridgeContext,\n    path: &str,\n    payload: Value,\n) -> serde_json::Value {\n    let started = Instant::now();\n    let _ = crate::diagnostic_log::append_diagnostic_log(\n        \"bridge.request\",\n        json!({\n            \"path\": path,\n            \"payload_keys\": payload\n                .as_object()\n                .map(|object| object.keys().cloned().collect::<Vec<_>>())\n                .unwrap_or_default()\n        }),","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/routes.rs#L108-L144","documentation":"import_session_file mirrors export_session_file: it raises the sentinel 'Session file import is unavailable' because the concrete BridgeDataService in this route context does not implement session-file import. The request reached a handler whose data service lacks the capability.","triggerScenarios":"Calling import_session_file on a backend that does not override the default method.","commonSituations":"Attempt to import a previously exported session file against a minimal/fallback backend; tests hitting the trait default.","solutions":["Use a backend that overrides import_session_file","Handle the error as an unsupported-feature case","Hide the import option when the backend lacks support"],"exampleFix":"// before\nstore.import_session_file(payload).await?;\n// after\nif let Err(e) = store.import_session_file(payload).await {\n    if e.to_string().contains(\"unavailable\") { notify_unsupported(); return Ok(()); }\n    return Err(e.into());\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"match store.import_session_file(payload).await {\n    Ok(v) => reload_sessions(v),\n    Err(e) if e.to_string().contains(\"unavailable\") => show_unsupported_message(),\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Gate the import action on backend capability","Implement import_session_file in user-facing backends","Warn users before export that the target backend may not support import-back"],"tags":["not-implemented","session-import","trait-default"],"backgroundTag":"method-not-implemented","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}