{"record":{"id":"a6ef87991ea932e0","repo":"nautechsystems/nautilus_trader","slug":"not-yet-implemented","errorCode":null,"errorMessage":"not yet implemented","messagePattern":"not yet implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/infrastructure/src/sql/cache.rs","lineNumber":879,"sourceCode":"        let pool = self.pool.clone();\n        let position_id = position_id.to_owned();\n        let (tx, rx) = std::sync::mpsc::channel();\n\n        tokio::spawn(async move {\n            let result = DatabaseQueries::load_position(&pool, &position_id).await;\n            if let Err(e) = tx.send(result) {\n                log::error!(\"Failed to send position {position_id}: {e:?}\");\n            }\n        });\n        rx.recv()?\n    }\n\n    fn load_actor(&self, actor_id: &ActorId) -> anyhow::Result<AHashMap<String, Bytes>> {\n        anyhow::bail!(\"load_actor not implemented for PostgreSQL cache adapter: {actor_id}\")\n    }\n\n    fn delete_actor(&self, _actor_id: &ActorId) -> anyhow::Result<()> {\n        todo!()\n    }\n\n    fn load_strategy(&self, strategy_id: &StrategyId) -> anyhow::Result<AHashMap<String, Bytes>> {\n        anyhow::bail!(\"load_strategy not implemented for PostgreSQL cache adapter: {strategy_id}\")\n    }\n\n    fn delete_strategy(&self, _strategy_id: &StrategyId) -> anyhow::Result<()> {\n        todo!()\n    }\n\n    fn delete_order(&self, client_order_id: &ClientOrderId) -> anyhow::Result<()> {\n        anyhow::bail!(\n            \"delete_order not implemented for PostgreSQL cache adapter: {client_order_id}\"\n        )\n    }\n\n    fn delete_position(&self, position_id: &PositionId) -> anyhow::Result<()> {\n        anyhow::bail!(\"delete_position not implemented for PostgreSQL cache adapter: {position_id}\")","sourceCodeStart":861,"sourceCodeEnd":897,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/infrastructure/src/sql/cache.rs#L861-L897","documentation":"The PostgreSQL cache adapter's delete_actor is a stub: instead of deleting an actor's stored data it calls todo!(), which panics with 'not yet implemented'. The operation is simply not supported by this backend yet.","triggerScenarios":"Calling cache.delete_actor(actor_id) on a cache database backed by the PostgreSQL adapter (NautilusPostgresCacheDatabase), e.g. while purging actor state from a live or backtest run.","commonSituations":"Running the same deletion code path that works with Redis/series backends but not with the Postgres adapter; enabling actor snapshot deletion in a Postgres-backed deployment.","solutions":["Do not call delete_actor with the PostgreSQL adapter; guard the call by backend type","Implement delete_actor in crates/infrastructure/src/sql/cache.rs with the corresponding DELETE query","Use a backend that supports actor deletion (e.g. the Redis adapter) if deletion is required","Track upstream for the TODO being implemented and upgrade"],"exampleFix":"// before\ncache_db.delete_actor(&actor_id)?; // panics with Postgres adapter\n// after\nmatch cache_db {\n    CacheBackend::Postgres(_) => log::warn!(\"delete_actor unsupported on Postgres adapter; skipped\"),\n    _ => cache_db.delete_actor(&actor_id)?,\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// cannot catch todo!() panic in-process; feature-detect before calling\nif !cache_db.supports(CacheFeature::DeleteActor) {\n    log::warn!(\"delete_actor unsupported on Postgres adapter; skipped\");\n} else {\n    cache_db.delete_actor(&actor_id)?;\n}","preventionTips":["Check backend capability (Postgres adapter) before invoking delete operations","Do not reuse Redis-specific purge routines with the Postgres adapter","Pin/track upstream versions where the stub is implemented","Consider implementing the method upstream via contribution"],"tags":["rust","postgres","not-implemented","panic"],"backgroundTag":"method-not-implemented","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}