diff --git a/deltachat-jsonrpc/typescript/test/online.ts b/deltachat-jsonrpc/typescript/test/online.ts index 97f97fb51..e6bdf5975 100644 --- a/deltachat-jsonrpc/typescript/test/online.ts +++ b/deltachat-jsonrpc/typescript/test/online.ts @@ -148,7 +148,6 @@ describe("online tests", function () { expect(message2.text).equal("super secret message"); expect(message2.showPadlock).equal(true); }); - }); async function waitForEvent( diff --git a/deltachat-rpc-client/tests/test_something.py b/deltachat-rpc-client/tests/test_something.py index 1efb7c48d..214dfc730 100644 --- a/deltachat-rpc-client/tests/test_something.py +++ b/deltachat-rpc-client/tests/test_something.py @@ -747,28 +747,6 @@ def test_early_failure(tmp_path) -> None: rpc.start() -def test_provider_info(rpc) -> None: - account_id = rpc.add_account() - - provider_info = rpc.get_provider_info(account_id, "example.org") - assert provider_info["id"] == "example.com" - - provider_info = rpc.get_provider_info(account_id, "uep7oiw4ahtaizuloith.org") - assert provider_info is None - - # Test MX record resolution. - # This previously resulted in Gmail provider - # because MX record pointed to google.com domain, - # but MX record resolution has been removed. - provider_info = rpc.get_provider_info(account_id, "github.com") - assert provider_info is None - - # Disable MX record resolution. - rpc.set_config(account_id, "proxy_enabled", "1") - provider_info = rpc.get_provider_info(account_id, "github.com") - assert provider_info is None - - def test_mdn_doesnt_break_autocrypt(acfactory) -> None: alice, bob = acfactory.get_online_accounts(2) diff --git a/python/tests/test_4_lowlevel.py b/python/tests/test_4_lowlevel.py index b70248fc2..683263f97 100644 --- a/python/tests/test_4_lowlevel.py +++ b/python/tests/test_4_lowlevel.py @@ -171,14 +171,6 @@ def test_get_special_message_id_returns_empty_message(acfactory): assert msg.id == 0 -def test_provider_info_none(): - ctx = ffi.gc( - lib.dc_context_new(ffi.NULL, ffi.NULL, ffi.NULL), - lib.dc_context_unref, - ) - assert lib.dc_provider_new_from_email(ctx, cutil.as_dc_charpointer("email@unexistent.no")) == ffi.NULL - - def test_get_info_open(tmp_path): db_fname = tmp_path / "test.db" ctx = ffi.gc( diff --git a/src/configure.rs b/src/configure.rs index 16b4fd557..bee801beb 100644 --- a/src/configure.rs +++ b/src/configure.rs @@ -335,21 +335,18 @@ impl Context { self.try_make_space_for_new_relay().await?; } - match configure(self, param).await { - Err(error) => { - // Log entered and actual params - let configured_param = get_configured_param(self, param).await; - warn!( - self, - "configure failed: Entered params: {}. Used params: {}. Error: {error}.", - param.to_string(), - configured_param - .map(|param| param.to_string()) - .unwrap_or("error".to_owned()) - ); - return Err(error); - } - Ok(()) => (), + if let Err(error) = configure(self, param).await { + // Log entered and actual params + let configured_param = get_configured_param(self, param).await; + warn!( + self, + "configure failed: Entered params: {}. Used params: {}. Error: {error}.", + param.to_string(), + configured_param + .map(|param| param.to_string()) + .unwrap_or("error".to_owned()) + ); + return Err(error); }; self.set_config_internal(Config::NotifyAboutWrongPw, Some("1")) .await?; @@ -436,8 +433,7 @@ async fn get_configured_param( progress!(ctx, 200); - let param_autoconfig; - if param.imap.server.is_empty() + let param_autoconfig = if param.imap.server.is_empty() && param.imap.port == 0 && param.imap.security == Socket::Automatic && param.imap.user.is_empty() @@ -449,14 +445,14 @@ async fn get_configured_param( // no advanced parameters entered by the user: do Autoconfig // except for a few known legacy-domain overrides. let legacy_servers = provider::legacy_settings_for_addr(¶m.addr).autoconfig_servers; - param_autoconfig = if legacy_servers.is_some() { + if legacy_servers.is_some() { legacy_servers } else { get_autoconfig(ctx, param, ¶m_domain).await - }; + } } else { - param_autoconfig = None; - } + None + }; progress!(ctx, 500);