Skip to content

Fix --delete-it-all and --delete commands#913

Merged
ellie merged 4 commits into
atuinsh:mainfrom
edeustua:fix_delete
Jun 13, 2023
Merged

Fix --delete-it-all and --delete commands#913
ellie merged 4 commits into
atuinsh:mainfrom
edeustua:fix_delete

Conversation

@edeustua

@edeustua edeustua commented Apr 24, 2023

Copy link
Copy Markdown
Contributor

There are two issues with deleting:

  1. If --delete-it-all is used, atuin will enter an infinite loop since searches are performed on the whole history, including deleted items.
  2. Blanking the command field may violate the unique(timestamp, cwd, command) condition.

This PR adds a deleted_at is null condition to the search query to fix issue 1. And removes the blanking of the command to fix 2.

@vercel

vercel Bot commented Apr 24, 2023

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
atuin ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 13, 2023 7:32am

Comment thread atuin-client/src/database.rs
edeustua added 2 commits May 5, 2023 18:47
Since entries are searched everytime a delete process ends, the
--delete-it-all command will enter an infinite loop if searching the
whole history.
Command blanking may violate the `unique(timestamp, cwd, command)`
condition.
@ellie

ellie commented Jun 13, 2023

Copy link
Copy Markdown
Member

Sorry for the rebase, CI wasn't starting and needed a poke

@ellie ellie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for sorting this out!

Seeing as this is your first time contributing, if you would like a holographic contributors-only Atuin sticker, then please fill out this form!

We do also have a Discord if you'd like to ask any questions, or just fancy hanging out!

@ellie ellie enabled auto-merge (squash) June 13, 2023 07:35
@ellie ellie merged commit 79f7b1d into atuinsh:main Jun 13, 2023
@edeustua edeustua deleted the fix_delete branch June 14, 2023 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants