2021-04-20 22:53:07 +02:00
|
|
|
[package]
|
|
|
|
name = "atuin-client"
|
2023-07-08 22:11:25 +02:00
|
|
|
edition = "2021"
|
2021-04-20 22:53:07 +02:00
|
|
|
description = "client library for atuin"
|
2023-04-14 21:18:58 +02:00
|
|
|
|
2023-09-11 10:26:05 +02:00
|
|
|
rust-version = { workspace = true }
|
2023-04-14 21:18:58 +02:00
|
|
|
version = { workspace = true }
|
|
|
|
authors = { workspace = true }
|
|
|
|
license = { workspace = true }
|
|
|
|
homepage = { workspace = true }
|
|
|
|
repository = { workspace = true }
|
2021-04-20 22:53:07 +02:00
|
|
|
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
|
2022-04-22 22:14:23 +02:00
|
|
|
[features]
|
|
|
|
default = ["sync"]
|
2023-08-07 13:06:48 +02:00
|
|
|
sync = ["urlencoding", "reqwest", "sha2", "hex"]
|
2024-01-26 10:45:42 +01:00
|
|
|
check-update = []
|
2022-04-22 22:14:23 +02:00
|
|
|
|
2021-04-20 22:53:07 +02:00
|
|
|
[dependencies]
|
2024-03-11 15:33:03 +01:00
|
|
|
atuin-common = { path = "../atuin-common", version = "18.1.0" }
|
2021-04-20 22:53:07 +02:00
|
|
|
|
2023-04-14 21:18:58 +02:00
|
|
|
log = { workspace = true }
|
2023-06-26 08:52:37 +02:00
|
|
|
base64 = { workspace = true }
|
2024-02-06 16:34:03 +01:00
|
|
|
time = { workspace = true, features = ["macros", "formatting"] }
|
2023-04-14 21:18:58 +02:00
|
|
|
clap = { workspace = true }
|
|
|
|
eyre = { workspace = true }
|
|
|
|
directories = { workspace = true }
|
|
|
|
uuid = { workspace = true }
|
|
|
|
whoami = { workspace = true }
|
|
|
|
interim = { workspace = true }
|
|
|
|
config = { workspace = true }
|
|
|
|
serde = { workspace = true }
|
|
|
|
serde_json = { workspace = true }
|
2021-04-20 22:53:07 +02:00
|
|
|
parse_duration = "2.1.1"
|
2023-04-14 21:18:58 +02:00
|
|
|
async-trait = { workspace = true }
|
|
|
|
itertools = { workspace = true }
|
2023-06-13 09:43:06 +02:00
|
|
|
rand = { workspace = true }
|
2023-09-13 09:45:08 +02:00
|
|
|
shellexpand = "3"
|
2024-03-01 14:21:53 +01:00
|
|
|
sqlx = { workspace = true, features = ["sqlite", "regexp"] }
|
2021-09-09 12:46:46 +02:00
|
|
|
minspan = "0.1.1"
|
2023-07-14 20:41:20 +02:00
|
|
|
regex = "1.9.1"
|
2023-02-14 08:14:05 +01:00
|
|
|
serde_regex = "1.1.0"
|
2023-04-14 21:18:58 +02:00
|
|
|
fs-err = { workspace = true }
|
2022-04-23 19:34:41 +02:00
|
|
|
sql-builder = "3"
|
2022-05-09 08:46:52 +02:00
|
|
|
memchr = "2.5"
|
2023-06-15 12:29:40 +02:00
|
|
|
rmp = { version = "0.8.11" }
|
2023-08-18 22:45:29 +02:00
|
|
|
typed-builder = { workspace = true }
|
2023-06-26 08:52:37 +02:00
|
|
|
tokio = { workspace = true }
|
|
|
|
semver = { workspace = true }
|
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 18:57:49 +01:00
|
|
|
thiserror = { workspace = true }
|
2023-07-14 21:44:08 +02:00
|
|
|
futures = "0.3"
|
2023-08-18 22:45:29 +02:00
|
|
|
crypto_secretbox = "0.1.1"
|
2023-08-07 13:06:48 +02:00
|
|
|
generic-array = { version = "0.14", features = ["serde"] }
|
2024-02-06 16:34:03 +01:00
|
|
|
serde_with = "3.5.1"
|
2023-06-26 08:52:37 +02:00
|
|
|
|
|
|
|
# encryption
|
2023-12-02 23:47:41 +01:00
|
|
|
rusty_paseto = { version = "0.6.0", default-features = false }
|
|
|
|
rusty_paserk = { version = "0.3.0", default-features = false, features = [
|
2023-07-14 21:44:08 +02:00
|
|
|
"v4",
|
|
|
|
"serde",
|
|
|
|
] }
|
2022-04-22 22:14:23 +02:00
|
|
|
|
|
|
|
# sync
|
|
|
|
urlencoding = { version = "2.1.0", optional = true }
|
2023-04-14 21:18:58 +02:00
|
|
|
reqwest = { workspace = true, optional = true }
|
2022-04-25 08:13:30 +02:00
|
|
|
hex = { version = "0.4", optional = true }
|
|
|
|
sha2 = { version = "0.10", optional = true }
|
2024-02-08 14:34:41 +01:00
|
|
|
indicatif = "0.17.7"
|
2022-04-22 22:14:23 +02:00
|
|
|
|
|
|
|
[dev-dependencies]
|
|
|
|
tokio = { version = "1", features = ["full"] }
|
2023-07-14 21:44:08 +02:00
|
|
|
pretty_assertions = { workspace = true }
|