diff --git a/keyserver/addons/rust-node-addon/build.rs b/keyserver/addons/rust-node-addon/build.rs --- a/keyserver/addons/rust-node-addon/build.rs +++ b/keyserver/addons/rust-node-addon/build.rs @@ -9,7 +9,7 @@ fn main() { napi_build::setup(); - const VERSIONS_JS_PATH: &str = "../../../lib/facts/version.js"; + const VERSIONS_JS_PATH: &str = "../../src/version.js"; println!("cargo:rerun-if-changed={}", VERSIONS_JS_PATH); let js_path = Path::new(VERSIONS_JS_PATH); @@ -17,15 +17,15 @@ let version_line = content .lines() - .find(|line| line.contains("webAndKeyserverCodeVersion")) - .expect("Failed to find webAndKeyserverCodeVersion line"); + .find(|line| line.contains("keyserverCodeVersion")) + .expect("Failed to find keyserverCodeVersion line"); // Find a sequence in the input string that starts with - // 'webAndKeyserverCodeVersion', followed by any number of whitespace + // 'keyserverCodeVersion', followed by any number of whitespace // characters, an equals sign, any number of additional whitespace characters, // a series of one or more digits (and capture these digits), and finally a // semicolon. - let re = Regex::new(r"webAndKeyserverCodeVersion\s*=\s*(\d+);").unwrap(); + let re = Regex::new(r"keyserverCodeVersion\s*=\s*(\d+);").unwrap(); let version: u64 = re .captures(version_line) .and_then(|cap| cap.get(1)) diff --git a/keyserver/src/responders/version-responders.js b/keyserver/src/responders/version-responders.js --- a/keyserver/src/responders/version-responders.js +++ b/keyserver/src/responders/version-responders.js @@ -2,14 +2,15 @@ import t, { type TInterface } from 'tcomb'; -import { webAndKeyserverCodeVersion } from 'lib/facts/version.js'; import type { VersionResponse } from 'lib/types/device-types.js'; import { tShape } from 'lib/utils/validation-utils.js'; +import { keyserverCodeVersion } from '../version.js'; + export const versionResponseValidator: TInterface = tShape({ codeVersion: t.Number }); -const versionResponse = { codeVersion: webAndKeyserverCodeVersion }; +const versionResponse = { codeVersion: keyserverCodeVersion }; async function versionResponder(): Promise { return versionResponse; diff --git a/keyserver/src/version.js b/keyserver/src/version.js new file mode 100644 --- /dev/null +++ b/keyserver/src/version.js @@ -0,0 +1,3 @@ +// @flow + +export const keyserverCodeVersion = 38; diff --git a/lib/facts/version.js b/lib/facts/version.js deleted file mode 100644 --- a/lib/facts/version.js +++ /dev/null @@ -1,5 +0,0 @@ -// @flow - -// This file defines the version of both web and keyserver. Today they are -// deployed together, so their version are sourced from the same place. -export const webAndKeyserverCodeVersion = 38; diff --git a/web/app.react.js b/web/app.react.js --- a/web/app.react.js +++ b/web/app.react.js @@ -21,7 +21,6 @@ ModalProvider, useModalContext, } from 'lib/components/modal-provider.react.js'; -import { webAndKeyserverCodeVersion } from 'lib/facts/version.js'; import { createLoadingStatusSelector, combineLoadingStatuses, @@ -90,7 +89,7 @@ calendarRangeInactivityLimit: null, platformDetails: { platform: electron?.platform ?? 'web', - codeVersion: webAndKeyserverCodeVersion, + codeVersion: 38, stateVersion: persistConfig.version, }, });