Commit Graph

8 Commits

Author SHA1 Message Date
Ellie Huxtable
7bc6ccdd70
feat: rework record sync for improved reliability (#1478)
* feat: rework record sync for improved reliability

So, to tell a story

1. We introduced the record sync, intended to be the new algorithm to
   sync history.
2. On top of this, I added the KV store. This was intended as a simple
   test of the record sync, and to see if people wanted that sort of
   functionality
3. History remained syncing via the old means, as while it had issues it
   worked more-or-less OK. And we are aware of its flaws
4. If KV syncing worked ok, history would be moved across

KV syncing ran ok for 6mo or so, so I started to move across history.
For several weeks, I ran a local fork of Atuin + the server that synced
via records instead.

The record store maintained ordering via a linked list, which was a
mistake. It performed well in testing, but was really difficult to debug
and reason about. So when a few small sync issues occured, they took an
extremely long time to debug.

This PR is huge, which I regret. It involves replacing the "parent"
relationship that records once had (pointing to the previous record)
with a simple index (generally referred to as idx). This also means we
had to change the recordindex, which referenced "tails". Tails were the
last item in the chain.

Now that we use an "array" vs linked list, that logic was also replaced.
And is much simpler :D

Same for the queries that act on this data.

----

This isn't final - we still need to add

1. Proper server/client error handling, which has been lacking for a
   while
2. The actual history implementation on top
    This exists in a branch, just without deletions. Won't be much to
    add that, I just don't want to make this any larger than it already
    is

The _only_ caveat here is that we basically lose data synced via the old
record store. This is the KV data from before.

It hasn't been deleted or anything, just no longer hooked up. So it's
totally possible to write a migration script. I just need to do that.

* update .gitignore

* use correct endpoint

* fix for stores with length of 1

* use create/delete enum for history store

* lint, remove unneeded host_id

* remove prints

* add command to import old history

* add enable/disable switch for record sync

* add record sync to auto sync

* satisfy the almighty clippy

* remove file that I did not mean to commit

* feedback
2024-01-05 17:57:49 +00:00
Jamie Quigley
b2a0986ca6
Add nix files and install instructions (#477) 2023-02-15 09:04:07 +00:00
Satyarth Sampath
4a839dab44
Adds stats summary (#384)
* stat command parsing is handled without subcommands

* Updates match clause based on PR review

Co-authored-by: Conrad Ludgate <oon@conradludgate.com>

* updates value returned by match based on PR review

* adds vscode to gitignore

* use an if statement instead of match

Co-authored-by: Satyarth <satyarth.sampath@gojek.com>
Co-authored-by: Conrad Ludgate <oon@conradludgate.com>
2022-05-03 15:49:27 +01:00
mb6ockatf
6e280e253a
Add Russian documentation translation (#365)
* Translate config.md to russian

* Translate docs/import_ru.md to russian

* Translate docs/key-binding.md to russian

* Translate docs/list_ru.md to russian

* Correct misprint in config_ru.md

* Translate docs/search.md to russian

* Translate docs/server_ru.md to russian

* Translate docs/shell-completions.md to russian

* Translate docs/stats.md to russian

* Translate docs/sync.md to russian

* Add .idea/ to .gitignore

* Translated files are placed in a separate folder

* Correct misprint (~~истоии~~ => истории). Correct links between files

Co-authored-by: BigProject404 <bigproject404@yandex.ru>
2022-04-30 20:51:50 +00:00
Jakub Panek
93ab4e7842
ignore JetBrains IDEs, tidy-up imports (#348)
* ignore JB IDEs

* tidy-up imports

* add rustfmt config
2022-04-28 18:53:59 +01:00
Ellie Huxtable
a21737e2b7
Use cargo workspaces (#37)
* Switch to Cargo workspaces

Breaking things into "client", "server" and "common" makes managing the
codebase much easier!

client - anything running on a user's machine for adding history
server - handles storing/syncing history and running a HTTP server
common - request/response API definitions, common utils, etc

* Update dockerfile
2021-04-20 20:53:07 +00:00
Ellie Huxtable
f1ea7fdfb1 Ignore env file 2021-04-09 12:42:43 +01:00
Ellie Huxtable
27b9a94305 Initial commit
Currently writing shell history to a sqlite db :)

Could do with:

1) store exit code
2) store duration
3) tidy up main
4) ...remote stuff
2020-10-05 00:59:28 +01:00