From 9644fafebfb192bdfc45f6a46b771a418c1ec91d Mon Sep 17 00:00:00 2001 From: Varun Dhananjaya Date: Fri, 25 Oct 2024 15:36:40 -0400 Subject: [PATCH] [identity] bump native min supported version and add web min supported version Summary: bump native min supported version to 401, to resolve https://linear.app/comm/issue/ENG-9421/consider-marking-mobile-versions-below-401-unsupported-by-identity also introducing a web min supported version and setting it to 120, which is the web equivalent of 401 Test Plan: changed min supported versions on staging identity to one higher than my dev native/web versions. was logged out on both platforms with an alert/modal explaining why. was alerted that i should update when i tried to log back in. then changed min supported versions back to 401/120 and could log in again Reviewers: will Reviewed By: will Subscribers: ashoat, tomek Differential Revision: https://phab.comm.dev/D13790 --- services/identity/src/constants.rs | 3 ++- services/identity/src/grpc_services/shared.rs | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/services/identity/src/constants.rs b/services/identity/src/constants.rs index 46218e1690..248d28b2f7 100644 --- a/services/identity/src/constants.rs +++ b/services/identity/src/constants.rs @@ -299,7 +299,8 @@ pub const ONE_TIME_KEY_REFRESH_NUMBER: u32 = 5; // Minimum supported code versions -pub const MIN_SUPPORTED_NATIVE_VERSION: u64 = 270; +pub const MIN_SUPPORTED_NATIVE_VERSION: u64 = 401; +pub const MIN_SUPPORTED_WEB_VERSION: u64 = 120; // Request metadata diff --git a/services/identity/src/grpc_services/shared.rs b/services/identity/src/grpc_services/shared.rs index 915e2b39e4..074c60c61c 100644 --- a/services/identity/src/grpc_services/shared.rs +++ b/services/identity/src/grpc_services/shared.rs @@ -4,6 +4,7 @@ use tracing::trace; use crate::constants::{ request_metadata, tonic_status_messages, MIN_SUPPORTED_NATIVE_VERSION, + MIN_SUPPORTED_WEB_VERSION, }; pub use grpc_clients::identity::shared::PlatformMetadata; @@ -18,6 +19,14 @@ pub fn version_interceptor(req: Request<()>) -> Result, Status> { { Err(unsupported_version()) } + Some((version, platform)) + if (platform == "web" + || platform == "windows" + || platform == "mac_os") + && version < MIN_SUPPORTED_WEB_VERSION => + { + Err(unsupported_version()) + } _ => Ok(req), } }