atuin
atuin copied to clipboard
Panic shortly after importing
Performing these two actions consistently gets me a panic
oon@altair ~/code/rust/atuin main rm ~/.local/share/atuin/history.db
oon@altair ~/code/rust/atuin main atuin import zsh
Atuin
======================
🌍
🐘🐘🐘🐘
🐢
======================
Importing history...
Importing history from zsh
Import complete!
Followed by Up
oon@altair ~/code/rust/atuin main thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: OutOfRangeError(())', src/command/search.rs:45:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
https://github.com/ellie/atuin/blob/de2e34ac50/src/command/search.rs#L45
This seems to occur when chrono::Utc::now().sub(h.timestamp)
is negative. I'm not sure why, perhaps there's a discrepancy in the ~/.zsh_history
file where the timestamps are possibly a couple seconds in the future
pub fn to_std(&self) -> Result<StdDuration, OutOfRangeError> {
if self.secs < 0 {
return Err(OutOfRangeError(()));
}
Ok(StdDuration::new(self.secs as u64, self.nanos as u32))
}
I'm experiencing the same, also with atuin import zsh
using the cargo-installed version.
I believe we fixed this a while ago