From 86f50e0356e4b661be43c2aeba97a67d83910095 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Wed, 20 Dec 2023 09:03:04 +0000 Subject: feat: add semver checking to client requests (#1456) * feat: add semver checking to client requests This enforces that the client and the server run the same major version in order to sync successfully. We're using the `Atuin-Version` http header to transfer this information If the user is not on the same MAJOR, then they will see an error like this > Atuin version mismatch! In order to successfully sync, the client and the server must run the same *major* version > Client: 17.1.0 > Server: 18.1.0 > Error: could not sync records due to version mismatch This change means two things 1. We will now only increment major versions if there is a breaking change for sync 2. We can now add breaking changes to sync, for any version >17.1.0. Clients will fail in a meaningful way. * lint, fmt, etc * only check for client newer than server * Add version header to client too --- atuin-common/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'atuin-common/Cargo.toml') diff --git a/atuin-common/Cargo.toml b/atuin-common/Cargo.toml index 88c3022e..847cea96 100644 --- a/atuin-common/Cargo.toml +++ b/atuin-common/Cargo.toml @@ -20,6 +20,9 @@ rand = { workspace = true } typed-builder = { workspace = true } eyre = { workspace = true } sqlx = { workspace = true } +semver = { workspace = true } + +lazy_static = "1.4.0" [dev-dependencies] pretty_assertions = { workspace = true } -- cgit v1.3.1