atuinsh / atuin

✨ Magical shell history
https://atuin.sh
MIT License
20.4k stars 554 forks source link

[Bug]: old history isn't shared but was imported on first sync? new history is syncing. #2389

Open NelsonMinar opened 3 weeks ago

NelsonMinar commented 3 weeks ago

What did you expect to happen?

I'm a new Atuin user, username NelsonMinar. My second Atuin install isn't showing me the history from my first one. It looks like the data was copied over though.

It's possible this is my misunderstanding. Am I right: with Atuin sync when I hit Ctrl-R on any machine the popup for [ GLOBAL ] should show me roughly the same data and history size? Because for me one machine is showing history count: 8641 and the other is showing history count: 551.

Thank you for Atuin, it is very cool.

What happened?

I ran Atuin on one machine for a few weeks and successfully have been using a ~8500 line history database that I imported from several years of bash hackery. I set up Atuin sync with the cloud server, then set up the Atuin client on a second machine and logged it in to sync. The first time I ran atuin sync it said it was downloading some 16,000 records. But the history only shows 500 items on this new machine and no matter how many times I sync -f on both hosts, I can't get the old commands from the other host to show up.

New commands I've run are showing up, just not the old bash imported ones.

I tried debugging suggestions from #1596 and #2379 and didn't learn anything. The problem persists. I'm wondering if these comments about timestamps could be relevant? I believe my 8500 line bash history imported without timestamps. I do think I'm using syncv2 though.

FWIW history.db on the second machine only has 578 rows in the history table. But records.db has 16,601 rows in the store table, making me think the data did get copied over from the sync but isn't being used.

Atuin doctor output

##### Atuin Doctor

{
  "atuin": {
    "version": "18.3.0",
    "sync": {
      "cloud": true,
      "records": true,
      "auto_sync": true,
      "last_sync": "2024-09-17 0:07:47.728149404 +00:00:00"
    },
    "sqlite_version": "3.44.0"
  },
  "shell": {
    "name": "bash",
    "default": "bash",
    "plugins": [
      "atuin",
      "bash-preexec"
    ],
    "preexec": "bash-preexec"
  },
  "system": {
    "os": "Ubuntu",
    "arch": "x86_64",
    "version": "23.04",
    "disks": [
      {
        "name": "/dev/vda2",
        "filesystem": "btrfs"
      },
      {
        "name": "systemd-1",
        "filesystem": "autofs"
      },
      {
        "name": "systemd-1",
        "filesystem": "autofs"
      },
      {
        "name": "/dev/vda1",
        "filesystem": "vfat"
      }
    ]
  }
}

##### cconfig.toml

enter_accept = false
style = "compact"
[stats]
[keys]
[sync]
records = true
[preview]
[daemon]

Code of Conduct

ellie commented 6 days ago

Could you share the doctor output from both machines please?

If they both have atuin.sync.records = true in the doctor output, you could try running atuin store rebuild history on the one that has a full records.db but empty history.db