Skip to content

Comments

Feat: Version check gating for startup and upload (TT-1832)#69

Open
wrestlingcarbonapple wants to merge 10 commits intomasterfrom
feat/version-check-TT-1832
Open

Feat: Version check gating for startup and upload (TT-1832)#69
wrestlingcarbonapple wants to merge 10 commits intomasterfrom
feat/version-check-TT-1832

Conversation

@wrestlingcarbonapple
Copy link
Contributor

@wrestlingcarbonapple wrestlingcarbonapple commented Feb 20, 2026

  • Added backend-driven desktop version gating with strict version parsing (vN.N.N or N.N.N, no appended metadata).
  • Introduced explicit version status handling (UP_TO_DATE, PATCH_AVAILABLE, MINOR_BLOCKING, MAJOR_BLOCKING) so
    frontend logic does not depend on parsing message text.
  • Startup flow now uses backend version status for blocking/manual-login behavior.
  • Added upload-time version gate before S3 actions; blocking versions disable action and show message in side panel.
  • Refactored version parsing and startup policy logic for readability and reduced verbosity.
  • Added/updated tests for version scenarios and token-fetch failure paths.

@wrestlingcarbonapple wrestlingcarbonapple changed the title Feat: Implement version check and startup blocking logic Feat: Version check gating for startup and upload (TT-1832) Feb 20, 2026
@wrestlingcarbonapple wrestlingcarbonapple marked this pull request as ready for review February 20, 2026 09:28
Comment on lines 303 to 322
let version_uri = desktop_version_uri
.map(|uri| uri.trim().to_string())
.filter(|uri| !uri.is_empty())
.ok_or_else(|| {
"Mangler konfigurasjon for versjonssjekk (VITE_PAPI_API_DESKTOP_VERSION_URI)."
.to_string()
})?;

let current_version = env!("CARGO_PKG_VERSION").to_string();
let current_version_text = format!("v{current_version}");
let latest_version = fetch_latest_desktop_version(&version_uri)
.await
.map_err(|e| format!("{e} (nåværende versjon: {current_version_text})"))?;
let version_policy = evaluate_startup_version_policy(&current_version, &latest_version)?;

secret_variables.current_version = Some(current_version.clone());
secret_variables.latest_version = Some(latest_version.clone());
secret_variables.startup_version_status = Some(version_policy.status);
secret_variables.startup_version_message = version_policy.startup_version_message;
secret_variables.auto_login_allowed = version_policy.auto_login_allowed;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Versjonsgreierne er jo strengt tatt ikke del av secrets. Var tenkt som direkte VAULT object nestn.

Tenker egentlig versjonshåndteringen kan holdes unna secrets.

Comment on lines 130 to 139
#[serde(skip_deserializing, default)]
pub(crate) startup_version_message: Option<String>,
#[serde(skip_deserializing, default)]
pub(crate) startup_version_status: Option<StartupVersionStatus>,
#[serde(skip_deserializing, default)]
pub(crate) current_version: Option<String>,
#[serde(skip_deserializing, default)]
pub(crate) latest_version: Option<String>,
#[serde(skip_deserializing, default = "default_auto_login_allowed")]
pub(crate) auto_login_allowed: bool,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Egen struct for versjonshåndtering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants