{"record":{"id":"e3a15f388d8c6c46","repo":"tinyhumansai/openhuman","slug":"failed-to-load-notion-sync-state-for-memory-cleanu","errorCode":null,"errorMessage":"failed to load notion sync state for memory cleanup: {error}","messagePattern":"failed to load notion sync state for memory cleanup: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/integrations/composio/ops/memory_cleanup.rs","lineNumber":101,"sourceCode":"\nasync fn notion_memory_targets_for_connection(\n    config: &Config,\n    connection_id: &str,\n) -> anyhow::Result<Vec<MemoryCleanupTarget>> {\n    let mut targets = connection_scoped_document_targets(\"notion\", connection_id);\n\n    let memory = Arc::new(\n        MemoryClient::from_workspace_dir(config.workspace_dir.clone()).map_err(|error| {\n            anyhow::anyhow!(\n                \"failed to open memory client for notion cleanup target discovery: {error}\"\n            )\n        })?,\n    );\n    let adapter = tinymemory_core::tinycortex::HostSyncAdapter::new(memory);\n    let state = tinycortex::memory::sync::SyncState::load(&adapter, \"notion\", connection_id)\n        .await\n        .map_err(|error| {\n            anyhow::anyhow!(\"failed to load notion sync state for memory cleanup: {error}\")\n        })?;\n    for raw_id in state.synced_ids {\n        let Some(page_id) = notion_synced_page_id(&raw_id) else {\n            continue;\n        };\n        targets.push(MemoryCleanupTarget::Exact(\n            SourceKind::Document,\n            format!(\"notion:{page_id}\"),\n        ));\n        targets.push(MemoryCleanupTarget::Exact(\n            SourceKind::Document,\n            format!(\"composio-notion-page-{page_id}\"),\n        ));\n    }\n\n    Ok(dedupe_memory_targets(targets))\n}\n","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/integrations/composio/ops/memory_cleanup.rs#L83-L119","documentation":"The notion sync-state load (via HostSyncAdapter over the opened MemoryClient) failed while enumerating cleanup targets for a connection being deleted. Without the sync state the exact notion document targets cannot be determined.","triggerScenarios":"Thrown at src/openhuman/integrations/composio/ops/memory_cleanup.rs:101 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the disconnect after the sync state settles","Check the underlying {error} for a store corruption or schema mismatch","Re-run the notion sync once, then disconnect again"],"exampleFix":null,"handlingStrategy":"fallback","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-14T05:17:10.506Z"}