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 --- Cargo.lock | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Cargo.lock') diff --git a/Cargo.lock b/Cargo.lock index d3605105..f84e25c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -249,8 +249,10 @@ name = "atuin-common" version = "17.1.0" dependencies = [ "eyre", + "lazy_static", "pretty_assertions", "rand", + "semver", "serde", "sqlx", "time", -- cgit v1.3.1