From c41657d7fd261823406214eb57ad48d87a6712f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?bi=C3=B8rn?= Date: Wed, 16 Sep 2026 21:44:50 +0200 Subject: [PATCH] test: explicitly empty url in appversion updates (#8702) desktop will probably not always use a URL, see https://github.com/deltachat/deltachat-desktop/issues/6749, make sure, this stays optional in the JSON. successor of https://github.com/chatmail/core/pull/8557 --- src/appversions.rs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/appversions.rs b/src/appversions.rs index 1b211092c..22df7c178 100644 --- a/src/appversions.rs +++ b/src/appversions.rs @@ -388,4 +388,40 @@ mod tests { Ok(()) } + + // some systems may not get the update URL from the relays, but use a specific one. + // this is esp. useful when the app binary is not signed. + #[tokio::test(flavor = "multi_thread", worker_threads = 2)] + async fn test_get_app_versions_no_url() -> Result<()> { + let dir = tempfile::tempdir().unwrap(); + let p: PathBuf = dir.path().join("accounts"); + let writable = true; + let mut accounts = Accounts::new(p.clone(), writable).await.unwrap(); + + let account_id1 = accounts.add_account().await?; + let json = r##"{ + "clients": [ + { + "clientId": "deltawin", + "sources": [ + { + "sourceId": "windows-3.11", + "versionInteger": 300, + "versionString": "3.00.000" + } + ] + } + ] + }"##; + mockup_app_versions(&accounts, account_id1, 1, json).await; + + let version = get_app_version(&accounts, "deltawin", "windows-3.11") + .await? + .unwrap(); + assert_eq!(version.version_integer, 300); + assert_eq!(version.version_string, "3.00.000"); + assert_eq!(version.download_url, ""); // no url given results in default empty string + + Ok(()) + } }