{"record":{"id":"5f12b9e42bea05c3","repo":"nautechsystems/nautilus_trader","slug":"incompleteorderreports-detail","errorCode":null,"errorMessage":"IncompleteOrderReports: {detail}","messagePattern":"IncompleteOrderReports: (.+?)","errorType":"exception","errorClass":"IncompleteOrderReports","httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/execution.rs","lineNumber":5145,"sourceCode":"// account, so a market-scoped sweep can serve nothing while older trades for that\n// market have already been evicted by newer trades in other markets.\nstruct FillSweep {\n    reports: Vec<FillReport>,\n    covers_window: bool,\n}\n\n#[derive(Debug, thiserror::Error)]\n#[error(\"incomplete Lighter order reports: {detail}\")]\nstruct IncompleteOrderReports {\n    reports: Vec<OrderStatusReport>,\n    detail: String,\n}\n\nfn incomplete_order_reports(\n    reports: Vec<OrderStatusReport>,\n    detail: impl Into<String>,\n) -> anyhow::Error {\n    anyhow::Error::new(IncompleteOrderReports {\n        reports,\n        detail: detail.into(),\n    })\n}\n\nfn partial_order_reports(error: &anyhow::Error) -> Vec<OrderStatusReport> {\n    error\n        .downcast_ref::<IncompleteOrderReports>()\n        .map(|incomplete| incomplete.reports.clone())\n        .unwrap_or_default()\n}\n\nfn is_commission_error(error: &anyhow::Error) -> bool {\n    error\n        .chain()\n        .any(|cause| cause.downcast_ref::<LighterCommissionError>().is_some())\n}\n","sourceCodeStart":5127,"sourceCodeEnd":5163,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/execution.rs#L5127-L5163","documentation":"Helper constructor for the IncompleteOrderReports error type: thrown when Lighter order-status report reconciliation yields fewer/incorrect reports than expected (e.g. generating batch submit results where a position/status report is missing). The reports gathered so far are carried in the error so callers can inspect what was recovered, and `detail` explains the discrepancy.","triggerScenarios":"Calls to incomplete_order_reports(reports, detail) — e.g. when generating order status reports or submit results and some orders lack a matching status report from the venue (missing/None report, cancelled mid-reconcile, or venue returned partial data).","commonSituations":"Requesting open-orders/status during venue instability, orders whose market_id cannot be mapped, or polling status immediately after submission before the venue persists the order.","solutions":["Read the `detail` and the carried reports to see which orders are incomplete.","Re-query the venue for the missing order IDs after a short delay and reconcile again.","Check that client_order_id <-> venue order id mappings in the cache are intact.","Retry reconciliation; transient light-out gaps on Lighter commonly cause partial report sets."],"exampleFix":"// before\nlet reports = client.generate_order_status_reports(&ids).await?; // may be IncompleteOrderReports\n// after\nmatch client.generate_order_status_reports(&ids).await { Err(e) if is_incomplete(&e) => { sleep(RETRY).await; client.generate_order_status_reports(&ids).await } r => r }","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match client.generate_order_status_reports(&ids).await {\n    Err(e) if format!(\"{e:#}\").contains(\"IncompleteOrderReports\") => {\n        tokio::time::sleep(RECONCILE_DELAY).await;\n        client.generate_order_status_reports(&ids).await?; // re-query missing reports\n    }\n    r => r?,\n}","preventionTips":["Delay reconciliation shortly after order submission so the venue has persisted the order","Keep client_order_id mappings intact in the cache","Treat partial report sets as retryable and re-query only missing IDs","Monitor venue status; reconcile after incidents clear"],"tags":["rust","lighter","order-status","reconciliation"],"backgroundTag":"empty-result-set","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"}