diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2024-01-22 17:06:34 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-22 17:06:34 +0000 |
| commit | 6af6c9066b8c054ea40021a64bb6ea56d14ff22f (patch) | |
| tree | 3d13bf8013385ff9413fa824d311f61d89f2a460 /atuin-client/src | |
| parent | feat: make store init idempotent (#1609) (diff) | |
| download | atuin-6af6c9066b8c054ea40021a64bb6ea56d14ff22f.zip | |
fix(tui): dedupe was removing history (#1610)
Related: https://forum.atuin.sh/t/search-ignoring-commands/74/5?u=ellie
When a user ran a duplicated command, but in another session, it was
removed by filters. This is because the subquery that was once used did
not have the same filters applied as the main query.
Instead of messing with subqueries, `group by` instead. This aligns with
the search() function
Diffstat (limited to 'atuin-client/src')
| -rw-r--r-- | atuin-client/src/database.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/atuin-client/src/database.rs b/atuin-client/src/database.rs index e61d6ed7..19fccb0c 100644 --- a/atuin-client/src/database.rs +++ b/atuin-client/src/database.rs @@ -306,10 +306,7 @@ impl Database for Sqlite { } if unique { - query.and_where_eq( - "timestamp", - "(select max(timestamp) from history where h.command = history.command)", - ); + query.group_by("command").having("max(timestamp)"); } if let Some(max) = max { |
