mirror of
https://github.com/atuinsh/atuin.git
synced 2024-12-26 17:09:14 +01:00
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
This commit is contained in:
parent
600ebc33ab
commit
6af6c9066b
@ -306,10 +306,7 @@ impl Database for Sqlite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if unique {
|
if unique {
|
||||||
query.and_where_eq(
|
query.group_by("command").having("max(timestamp)");
|
||||||
"timestamp",
|
|
||||||
"(select max(timestamp) from history where h.command = history.command)",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(max) = max {
|
if let Some(max) = max {
|
||||||
|
Loading…
Reference in New Issue
Block a user