Skip to content

Commit

Permalink
🐛 Fix check-for-update false positive
Browse files Browse the repository at this point in the history
Fixes #320
  • Loading branch information
aaronleopold committed May 1, 2024
1 parent bf82e01 commit a4ac5d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/server/src/routers/api/v1/mod.rs
Expand Up @@ -137,11 +137,15 @@ async fn check_for_updates() -> APIResult<Json<UpdateCheck>> {
if github_response.status().is_success() {
let github_json: serde_json::Value = github_response.json().await?;

let latest_semver = github_json["tag_name"].as_str().ok_or_else(|| {
let mut latest_semver = github_json["tag_name"].as_str().ok_or_else(|| {
APIError::InternalServerError(
"Failed to parse latest release tag name".to_string(),
)
})?;
if latest_semver.starts_with('v') && latest_semver.len() > 1 {
latest_semver = &latest_semver[1..];
}

let has_update_available = latest_semver != current_semver;

Ok(Json(UpdateCheck {
Expand Down

0 comments on commit a4ac5d9

Please sign in to comment.