Feat: Version check gating for startup and upload (TT-1832)#69
Open
wrestlingcarbonapple wants to merge 10 commits intomasterfrom
Open
Feat: Version check gating for startup and upload (TT-1832)#69wrestlingcarbonapple wants to merge 10 commits intomasterfrom
wrestlingcarbonapple wants to merge 10 commits intomasterfrom
Conversation
Sindrir
requested changes
Feb 20, 2026
src-tauri/src/lib.rs
Outdated
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(¤t_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; |
Member
There was a problem hiding this comment.
Versjonsgreierne er jo strengt tatt ikke del av secrets. Var tenkt som direkte VAULT object nestn.
Tenker egentlig versjonshåndteringen kan holdes unna secrets.
src-tauri/src/model.rs
Outdated
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, |
Member
There was a problem hiding this comment.
Egen struct for versjonshåndtering
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
frontend logic does not depend on parsing message text.