{"record":{"id":"3c3579445fbe8c16","repo":"atuinsh/atuin","slug":"bug-in-list-query-please-report","errorCode":null,"errorMessage":"bug in list query. please report","messagePattern":"bug in list query\\. please report","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin-client/src/database.rs","lineNumber":506,"sourceCode":"            };\n        }\n\n        if unique {\n            query.group_by(\"command\").having(\"max(timestamp)\");\n        }\n\n        if let Some(max) = max {\n            query.limit(max);\n        }\n\n        // Inclusive on both ends, matching `range()`. `stats` relies on this to count a\n        // command recorded exactly on a period boundary (e.g. at midnight).\n        if let Some((from, to)) = range {\n            query.and_where_ge(\"timestamp\", from.unix_timestamp_nanos() as i64);\n            query.and_where_le(\"timestamp\", to.unix_timestamp_nanos() as i64);\n        }\n\n        let query = query.sql().expect(\"bug in list query. please report\");\n\n        let res = sqlx::query(sqlx::AssertSqlSafe(query))\n            .map(Self::row_to_history)\n            .fetch_all(&self.pool)\n            .await?;\n\n        Ok(res)\n    }\n\n    pub async fn range(&self, from: OffsetDateTime, to: OffsetDateTime) -> Result<Vec<History>> {\n        debug!(\"listing history from {:?} to {:?}\", from, to);\n\n        let res = sqlx::query(\n            \"select * from history where timestamp >= ?1 and timestamp <= ?2 order by timestamp \\\n             asc\",\n        )\n        .bind(from.unix_timestamp_nanos() as i64)\n        .bind(to.unix_timestamp_nanos() as i64)","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/atuinsh/atuin/blob/15fe1318f1df51de604262eb50734c9883d48e7b/crates/atuin-client/src/database.rs#L488-L524","documentation":"Error \"bug in list query. please report\" thrown in atuinsh/atuin.","triggerScenarios":"Fires when the history list query returns inconsistent data, indicating an internal bug to report.","commonSituations":"See trigger scenarios.","solutions":["This is an internal query bug; report it with the command and filters you used."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"15fe1318f1df51de604262eb50734c9883d48e7b","analyzedAt":"2026-08-19T08:56:57.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}