From fd0d07d21be39e4aa80a689c1ba2e19254a3601d Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Thu, 26 Nov 2026 23:38:19 +0100 Subject: [PATCH 01/43] Fix: IP Geolocation: Tab stuck after an error or the rate limit (X1) Co-Authored-By: Claude Opus 5.5 --- Source/NETworkManager/ViewModels/IPGeolocationViewModel.cs | 7 +++++-- Website/docs/changelog/next-release.md | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/NETworkManager/ViewModels/IPGeolocationViewModel.cs b/Source/NETworkManager/ViewModels/IPGeolocationViewModel.cs index 2e0a540f32..ce037e2b05 100644 --- a/Source/NETworkManager/ViewModels/IPGeolocationViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPGeolocationViewModel.cs @@ -289,8 +289,11 @@ private async Task Query() StatusMessageLevel = StatusLevel.Error; IsStatusMessageDisplayed = true; } - - IsRunning = false; + finally + { + // Also after an error or the rate limit (early return), otherwise the tab stays busy + IsRunning = false; + } } /// diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index a4e355219f..e53868917c 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -178,6 +178,10 @@ Release date: **xx.xx.2026** - Fixed the status window being cut off on the left on small screens (e.g. 1280 x 720 with 150 % scaling). It is no longer wider than the screen. [#3734](https://github.com/BornToBeRoot/NETworkManager/pull/3734) - Fixed the status window opened by the user (e.g. from the tray icon) closing itself after a network change. It stays open and checks the network connection again. [#3734](https://github.com/BornToBeRoot/NETworkManager/pull/3734) +**IP Geolocation** + +- Fixed the tab getting stuck (query disabled, input read-only, progress bar running) after an error or when the rate limit of ip-api.com was reached, until the tab was closed. [#PR](PRLINK) + ## Dependencies, Refactoring & Documentation - Code cleanup & refactoring From 5bb7f4d1c1ce610db52d7f16e5e0f706c84c02a3 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Thu, 26 Nov 2026 23:41:51 +0100 Subject: [PATCH 02/43] Refactor: Dashboard: Shared error message of the web requests of the widgets Co-Authored-By: Claude Opus 5.5 --- .../ViewModels/SpeedTestWidgetViewModel.cs | 23 ++---------- .../NETworkManager/WebRequestErrorMessage.cs | 37 +++++++++++++++++++ 2 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 Source/NETworkManager/WebRequestErrorMessage.cs diff --git a/Source/NETworkManager/ViewModels/SpeedTestWidgetViewModel.cs b/Source/NETworkManager/ViewModels/SpeedTestWidgetViewModel.cs index ca97056c97..b085dfa807 100644 --- a/Source/NETworkManager/ViewModels/SpeedTestWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/SpeedTestWidgetViewModel.cs @@ -1,6 +1,5 @@ using System; using System.Collections.ObjectModel; -using System.Net.Http; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -374,24 +373,6 @@ private void ShowStatusMessage(string message, StatusLevel level) IsStatusMessageDisplayed = true; } - /// - /// Localized message for an error of the speed test (the exception text is logged). - /// - private static string GetErrorMessage(Exception ex) - { - var message = ex switch - { - TimeoutException => string.Format(Strings.XXXDidNotRespondWithinXXXSecondsMessage, SpeedTestService.Host, - SpeedTestService.RequestTimeout.TotalSeconds), - HttpRequestException { StatusCode: not null } httpEx => string.Format(Strings.CouldNotConnectToXXXReasonXXX, - SpeedTestService.Host, $"{Strings.HTTPStatusCode} {(int)httpEx.StatusCode}"), - _ => string.Format(Strings.CouldNotConnectToXXXMessage, SpeedTestService.Host) - }; - - // One message with its hint (a new line would look like a second message), wraps if the widget is narrow - return $"{message} {Strings.CheckNetworkConnectionTryAgainMessage}"; - } - /// /// Adds a sample (one completed request) to a sparkline and extends its X axis to the samples. /// @@ -507,7 +488,9 @@ private async Task RunAsync() { // Partial results remain visible, like after a cancel Log.Error("Speed test failed.", ex); - ShowStatusMessage(GetErrorMessage(ex), StatusLevel.Error); + ShowStatusMessage( + WebRequestErrorMessage.Get(SpeedTestService.Host, SpeedTestService.RequestTimeout, ex), + StatusLevel.Error); } finally { diff --git a/Source/NETworkManager/WebRequestErrorMessage.cs b/Source/NETworkManager/WebRequestErrorMessage.cs new file mode 100644 index 0000000000..59939123ff --- /dev/null +++ b/Source/NETworkManager/WebRequestErrorMessage.cs @@ -0,0 +1,37 @@ +using System; +using System.Net.Http; +using System.Threading.Tasks; +using NETworkManager.Localization.Resources; + +namespace NETworkManager; + +/// +/// Localized message for a failed web request of a dashboard widget (instead of the English exception text of .NET, +/// which is logged). +/// +public static class WebRequestErrorMessage +{ + /// + /// Gets the message for a failed request, with the hint to check the network connection. + /// + /// Host of the request (e.g. ip-api.com). + /// Timeout of the request (shown if it did not respond in time). + /// Error of the request: (also as the inner exception of the + /// of ), + /// with a status code (HTTP error) or any other error (no connection). + /// Message in one paragraph. + public static string Get(string host, TimeSpan timeout, Exception ex) + { + var message = ex switch + { + TimeoutException or { InnerException: TimeoutException } => string.Format( + Strings.XXXDidNotRespondWithinXXXSecondsMessage, host, timeout.TotalSeconds), + HttpRequestException { StatusCode: not null } httpEx => string.Format(Strings.CouldNotConnectToXXXReasonXXX, + host, $"{Strings.HTTPStatusCode} {(int)httpEx.StatusCode}"), + _ => string.Format(Strings.CouldNotConnectToXXXMessage, host) + }; + + // One message with its hint (a new line would look like a second message), wraps if the widget is narrow + return $"{message} {Strings.CheckNetworkConnectionTryAgainMessage}"; + } +} From a313f9405ec617ecd29f8dd179dc22ccaca7c9b9 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Thu, 26 Nov 2026 23:42:39 +0100 Subject: [PATCH 03/43] Fix: IP API: Request fails after 10 seconds without a response (B4) Co-Authored-By: Claude Opus 5.5 --- .../IPApi/DNSResolverService.cs | 13 ++++++++++++- .../IPApi/IPGeolocationService.cs | 14 +++++++++++++- Website/docs/changelog/next-release.md | 5 +++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Source/NETworkManager.Models/IPApi/DNSResolverService.cs b/Source/NETworkManager.Models/IPApi/DNSResolverService.cs index 67c86d04f4..869b566921 100644 --- a/Source/NETworkManager.Models/IPApi/DNSResolverService.cs +++ b/Source/NETworkManager.Models/IPApi/DNSResolverService.cs @@ -17,7 +17,18 @@ public class DNSResolverService : SingletonBase /// private const string BaseUrl = "https://edns.ip-api.com/json"; - private readonly HttpClient _client = new(); + /// + /// Host of the API (shown in messages). + /// + public const string Host = "edns.ip-api.com"; + + /// + /// Time until a request fails without a response (instead of the 100 seconds of , e.g. + /// if a firewall drops the request), like the public IP address request of the network connection widget. + /// + public static readonly TimeSpan RequestTimeout = TimeSpan.FromSeconds(10); + + private readonly HttpClient _client = new() { Timeout = RequestTimeout }; /// /// Gets the IP DNS details from the API asynchronously. diff --git a/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs b/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs index 02ef1f96d5..dd5bfb1572 100644 --- a/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs +++ b/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs @@ -25,7 +25,19 @@ public class IPGeolocationService : SingletonBase private const string Fields = "status,message,continent,continentCode,country,countryCode,region,regionName,city,district,zip,lat,lon,timezone,offset,currency,isp,org,as,asname,reverse,mobile,proxy,hosting,query"; - private readonly HttpClient _client = new(); + /// + /// Host of the API (shown in messages). + /// + public const string Host = "ip-api.com"; + + /// + /// Time until a request fails without a response (instead of the 100 seconds of , e.g. + /// if a firewall drops the request or for each hop of the traceroute), like the public IP address request of the + /// network connection widget. + /// + public static readonly TimeSpan RequestTimeout = TimeSpan.FromSeconds(10); + + private readonly HttpClient _client = new() { Timeout = RequestTimeout }; /// /// Indicates whether we have reached the rate limit. diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index e53868917c..f5a5cf18f1 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -181,6 +181,11 @@ Release date: **xx.xx.2026** **IP Geolocation** - Fixed the tab getting stuck (query disabled, input read-only, progress bar running) after an error or when the rate limit of ip-api.com was reached, until the tab was closed. [#PR](PRLINK) +- Fixed a query waiting up to 100 seconds when ip-api.com did not respond (e.g. a firewall that drops the request). It fails after 10 seconds. [#PR](PRLINK) + +**Traceroute** + +- Fixed the traceroute waiting up to 100 seconds per hop when the IP geolocation is enabled and ip-api.com did not respond (e.g. a firewall that drops the request). The geolocation of a hop fails after 10 seconds. [#PR](PRLINK) ## Dependencies, Refactoring & Documentation From 152c7550c1641ec991943ac5edd1e0988ffb1fa8 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Thu, 26 Nov 2026 23:48:28 +0100 Subject: [PATCH 04/43] Docs: Changelog: Link of PR #3741 Co-Authored-By: Claude Opus 5.5 --- Website/docs/changelog/next-release.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index f5a5cf18f1..cddc46ede5 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -180,12 +180,12 @@ Release date: **xx.xx.2026** **IP Geolocation** -- Fixed the tab getting stuck (query disabled, input read-only, progress bar running) after an error or when the rate limit of ip-api.com was reached, until the tab was closed. [#PR](PRLINK) -- Fixed a query waiting up to 100 seconds when ip-api.com did not respond (e.g. a firewall that drops the request). It fails after 10 seconds. [#PR](PRLINK) +- Fixed the tab getting stuck (query disabled, input read-only, progress bar running) after an error or when the rate limit of ip-api.com was reached, until the tab was closed. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed a query waiting up to 100 seconds when ip-api.com did not respond (e.g. a firewall that drops the request). It fails after 10 seconds. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Traceroute** -- Fixed the traceroute waiting up to 100 seconds per hop when the IP geolocation is enabled and ip-api.com did not respond (e.g. a firewall that drops the request). The geolocation of a hop fails after 10 seconds. [#PR](PRLINK) +- Fixed the traceroute waiting up to 100 seconds per hop when the IP geolocation is enabled and ip-api.com did not respond (e.g. a firewall that drops the request). The geolocation of a hop fails after 10 seconds. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) ## Dependencies, Refactoring & Documentation From 6232a66f4023eb2175a6d1284dbd98d56be750f9 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:02:37 +0100 Subject: [PATCH 05/43] Fix: Dashboard: IP geolocation / DNS resolver error shown translated below the header (B1) Co-Authored-By: Claude Opus 5.5 --- .../IPApi/DNSResolverResult.cs | 36 ++++----- .../IPApi/DNSResolverService.cs | 4 +- .../IPApi/IPGeolocationResult.cs | 24 +++++- .../IPApi/IPGeolocationService.cs | 5 +- .../IPApi/IPApiResultTests.cs | 58 ++++++++++++++ .../IPApiDNSResolverWidgetViewModel.cs | 58 +++++++++++++- .../IPApiIPGeolocationWidgetViewModel.cs | 76 +++++++++++++++++-- .../Views/IPApiDNSResolverWidgetView.xaml | 45 ++--------- .../Views/IPApiIPGeolocationWidgetView.xaml | 63 ++------------- Website/docs/changelog/next-release.md | 1 + 10 files changed, 246 insertions(+), 124 deletions(-) create mode 100644 Source/NETworkManager.Tests/IPApi/IPApiResultTests.cs diff --git a/Source/NETworkManager.Models/IPApi/DNSResolverResult.cs b/Source/NETworkManager.Models/IPApi/DNSResolverResult.cs index f23b2a54ab..950e42b43f 100644 --- a/Source/NETworkManager.Models/IPApi/DNSResolverResult.cs +++ b/Source/NETworkManager.Models/IPApi/DNSResolverResult.cs @@ -1,4 +1,7 @@ -namespace NETworkManager.Models.IPApi; +using System; +using System.Net.Http; + +namespace NETworkManager.Models.IPApi; /// /// Class contains the result of the DNS resolver information retrieval. @@ -15,25 +18,17 @@ public DNSResolverResult(DNSResolverInfo info) } /// - /// Create a new instance of with an error message. + /// Create a new instance of for a failed request. /// - /// Indicates if the DNS resolver information retrieval has failed. - /// Error message if the DNS resolver information retrieval has failed. - public DNSResolverResult(bool hasError, string errorMessage) + /// + /// Error of the request ( with the status code for an HTTP error). + /// + public DNSResolverResult(Exception error) { - HasError = hasError; - ErrorMessage = errorMessage; - } - - /// - /// Create a new instance of with an error message and an error code. - /// - /// Indicates if the DNS resolver information retrieval has failed. - /// Error message if the DNS resolver information retrieval has failed. - /// Error code if the DNS resolver information retrieval has failed. - public DNSResolverResult(bool hasError, string errorMessage, int errorCode) : this(hasError, errorMessage) - { - ErrorCode = errorCode; + HasError = true; + Error = error; + ErrorMessage = error.Message; + ErrorCode = error is HttpRequestException { StatusCode: not null } httpEx ? (int)httpEx.StatusCode : 0; } /// @@ -55,4 +50,9 @@ public DNSResolverResult(bool hasError, string errorMessage, int errorCode) : th /// Error code if the DNS resolver information retrieval has failed. /// public int ErrorCode { get; set; } + + /// + /// Error of the request, mapped to a localized message by the view model. + /// + public Exception Error { get; set; } } \ No newline at end of file diff --git a/Source/NETworkManager.Models/IPApi/DNSResolverService.cs b/Source/NETworkManager.Models/IPApi/DNSResolverService.cs index 869b566921..c172d9b2c6 100644 --- a/Source/NETworkManager.Models/IPApi/DNSResolverService.cs +++ b/Source/NETworkManager.Models/IPApi/DNSResolverService.cs @@ -48,11 +48,11 @@ public async Task GetDNSResolverAsync() return new DNSResolverResult(DNSResolverInfo.Parse(info)); } - return new DNSResolverResult(true, response.ReasonPhrase, (int)response.StatusCode); + return new DNSResolverResult(new HttpRequestException(response.ReasonPhrase, null, response.StatusCode)); } catch (Exception ex) { - return new DNSResolverResult(true, ex.Message); + return new DNSResolverResult(ex); } } } \ No newline at end of file diff --git a/Source/NETworkManager.Models/IPApi/IPGeolocationResult.cs b/Source/NETworkManager.Models/IPApi/IPGeolocationResult.cs index ba573767bc..97b025ddd3 100644 --- a/Source/NETworkManager.Models/IPApi/IPGeolocationResult.cs +++ b/Source/NETworkManager.Models/IPApi/IPGeolocationResult.cs @@ -1,4 +1,7 @@ -namespace NETworkManager.Models.IPApi; +using System; +using System.Net.Http; + +namespace NETworkManager.Models.IPApi; /// /// Class contains the result of the IP geolocation information retrieval. @@ -49,6 +52,20 @@ public IPGeolocationResult(bool hasError, string errorMessage, int errorCode) ErrorCode = errorCode; } + /// + /// Create a new instance of for a failed request. + /// + /// + /// Error of the request ( with the status code for an HTTP error). + /// + public IPGeolocationResult(Exception error) + { + HasError = true; + Error = error; + ErrorMessage = error.Message; + ErrorCode = error is HttpRequestException { StatusCode: not null } httpEx ? (int)httpEx.StatusCode : -1; + } + /// /// IP geolocation information retrieved from the API. /// @@ -78,4 +95,9 @@ public IPGeolocationResult(bool hasError, string errorMessage, int errorCode) /// Error code if the IP geolocation information retrieval has failed. /// public int ErrorCode { get; set; } + + /// + /// Error of the request, mapped to a localized message by the view model (null if the answer was invalid). + /// + public Exception Error { get; set; } } \ No newline at end of file diff --git a/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs b/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs index dd5bfb1572..d41e9eff6b 100644 --- a/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs +++ b/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs @@ -95,7 +95,8 @@ public async Task GetIPGeolocationAsync(string ipAddressOrF // Consider the request as failed if the status code is not successful or 429. if ((int)response.StatusCode != 429) - return new IPGeolocationResult(true, response.ReasonPhrase, (int)response.StatusCode); + return new IPGeolocationResult(new HttpRequestException(response.ReasonPhrase, null, + response.StatusCode)); // Code 429 // We have already reached the rate limit (on the network) @@ -109,7 +110,7 @@ public async Task GetIPGeolocationAsync(string ipAddressOrF } catch (Exception ex) { - return new IPGeolocationResult(true, ex.Message, -1); + return new IPGeolocationResult(ex); } } diff --git a/Source/NETworkManager.Tests/IPApi/IPApiResultTests.cs b/Source/NETworkManager.Tests/IPApi/IPApiResultTests.cs new file mode 100644 index 0000000000..1fd51e6338 --- /dev/null +++ b/Source/NETworkManager.Tests/IPApi/IPApiResultTests.cs @@ -0,0 +1,58 @@ +using System; +using System.Net; +using System.Net.Http; +using NETworkManager.Models.IPApi; +using Xunit; + +namespace NETworkManager.Tests.IPApi; + +public class IPApiResultTests +{ + [Fact] + public void IPGeolocationResultOfAnHttpErrorHasTheStatusCode() + { + var error = new HttpRequestException("Service Unavailable", null, HttpStatusCode.ServiceUnavailable); + + var result = new IPGeolocationResult(error); + + Assert.True(result.HasError); + Assert.Same(error, result.Error); + Assert.Equal(503, result.ErrorCode); + Assert.Equal("Service Unavailable", result.ErrorMessage); + } + + [Fact] + public void IPGeolocationResultWithoutResponseHasNoStatusCode() + { + var error = new TimeoutException(); + + var result = new IPGeolocationResult(error); + + Assert.True(result.HasError); + Assert.Same(error, result.Error); + Assert.Equal(-1, result.ErrorCode); + } + + [Fact] + public void DNSResolverResultOfAnHttpErrorHasTheStatusCode() + { + var error = new HttpRequestException("Bad Gateway", null, HttpStatusCode.BadGateway); + + var result = new DNSResolverResult(error); + + Assert.True(result.HasError); + Assert.Same(error, result.Error); + Assert.Equal(502, result.ErrorCode); + Assert.Equal("Bad Gateway", result.ErrorMessage); + } + + [Fact] + public void DNSResolverResultWithoutResponseHasNoStatusCode() + { + var result = new DNSResolverResult(new HttpRequestException("No such host is known.")); + + Assert.True(result.HasError); + Assert.Equal(0, result.ErrorCode); + Assert.Null(result.Info); + } +} diff --git a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs index cec3d50ef9..3029e8e3ca 100644 --- a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs @@ -1,5 +1,6 @@ using System.Threading.Tasks; using System.Windows.Input; +using NETworkManager.Controls; using NETworkManager.Models.IPApi; using NETworkManager.Settings; using NETworkManager.Utilities; @@ -45,6 +46,48 @@ private set } } + /// + /// Message of the last check, e.g. an error or the rate limit (shown below the header). + /// + public string StatusMessage + { + get; + private set + { + if (value == field) + return; + + field = value; + OnPropertyChanged(); + } + } + + public StatusLevel StatusMessageLevel + { + get; + private set + { + if (value == field) + return; + + field = value; + OnPropertyChanged(); + } + } + + public bool IsStatusMessageDisplayed + { + get; + private set + { + if (value == field) + return; + + field = value; + OnPropertyChanged(); + } + } + #endregion #region Constructor, load settings @@ -97,16 +140,29 @@ private async Task CheckAsync() return; IsRunning = true; + IsStatusMessageDisplayed = false; Result = null; // Takes at least the refresh interval, so the reload animation is visible and the check can't be spammed - // the request runs at the same time - Result = await TaskHelper.WithMinimumDurationAsync( + var result = await TaskHelper.WithMinimumDurationAsync( () => ScreenshotData.IsEnabled ? Task.FromResult(ScreenshotData.CreateDNSResolverResult()) : DNSResolverService.GetInstance().GetDNSResolverAsync(), GlobalStaticConfiguration.ApplicationUIRefreshInterval); + if (result.HasError) + { + StatusMessage = WebRequestErrorMessage.Get(DNSResolverService.Host, DNSResolverService.RequestTimeout, + result.Error); + StatusMessageLevel = StatusLevel.Error; + IsStatusMessageDisplayed = true; + } + else + { + Result = result; + } + IsRunning = false; } diff --git a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs index 1df73bd600..df44d477e6 100644 --- a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs @@ -1,6 +1,8 @@ using System.Threading.Tasks; using System.Windows.Input; using log4net; +using NETworkManager.Controls; +using NETworkManager.Localization.Resources; using NETworkManager.Models.IPApi; using NETworkManager.Settings; using NETworkManager.Utilities; @@ -48,6 +50,48 @@ private set } } + /// + /// Message of the last check, e.g. an error or the rate limit (shown below the header). + /// + public string StatusMessage + { + get; + private set + { + if (value == field) + return; + + field = value; + OnPropertyChanged(); + } + } + + public StatusLevel StatusMessageLevel + { + get; + private set + { + if (value == field) + return; + + field = value; + OnPropertyChanged(); + } + } + + public bool IsStatusMessageDisplayed + { + get; + private set + { + if (value == field) + return; + + field = value; + OnPropertyChanged(); + } + } + #endregion #region Constructor, load settings @@ -99,26 +143,44 @@ private async Task CheckAsync() return; IsRunning = true; + IsStatusMessageDisplayed = false; Result = null; // Takes at least the refresh interval, so the reload animation is visible and the check can't be spammed - // the request runs at the same time - Result = await TaskHelper.WithMinimumDurationAsync( + var result = await TaskHelper.WithMinimumDurationAsync( () => ScreenshotData.IsEnabled ? Task.FromResult(ScreenshotData.CreateIPGeolocationResult()) : IPGeolocationService.GetInstance().GetIPGeolocationAsync(), GlobalStaticConfiguration.ApplicationUIRefreshInterval); - // Log error - if (Result.HasError) - Log.Error($"ip-api.com error: {Result.ErrorMessage}, error code: {Result.ErrorCode}"); + if (result.HasError) + { + Log.Error($"ip-api.com error: {result.ErrorMessage}, error code: {result.ErrorCode}"); + + ShowStatusMessage(WebRequestErrorMessage.Get(IPGeolocationService.Host, + IPGeolocationService.RequestTimeout, result.Error), StatusLevel.Error); + } + else if (result.RateLimitIsReached) + { + Log.Warn($"ip-api.com rate limit reached. Try again in {result.RateLimitRemainingTime} seconds."); - // Log rate limit - if (Result.RateLimitIsReached) - Log.Warn($"ip-api.com rate limit reached. Try again in {Result.RateLimitRemainingTime} seconds."); + ShowStatusMessage(Strings.IPApiRateLimitMessage, StatusLevel.Warning); + } + else + { + Result = result; + } IsRunning = false; } + private void ShowStatusMessage(string message, StatusLevel level) + { + StatusMessage = message; + StatusMessageLevel = level; + IsStatusMessageDisplayed = true; + } + #endregion } \ No newline at end of file diff --git a/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml b/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml index 2855059cb3..0458d93a48 100644 --- a/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml +++ b/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml @@ -10,7 +10,6 @@ xmlns:networkManager="clr-namespace:NETworkManager" xmlns:settings="clr-namespace:NETworkManager.Settings;assembly=NETworkManager.Settings" xmlns:viewModels="clr-namespace:NETworkManager.ViewModels" - xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:wpfHelpers="clr-namespace:NETworkManager.Utilities.WPF;assembly=NETworkManager.Utilities.WPF" mc:Ignorable="d" MinHeight="200" d:DataContext="{d:DesignInstance viewModels:IPApiDNSResolverWidgetViewModel}"> @@ -21,8 +20,6 @@ - - @@ -36,7 +33,8 @@ - + + @@ -76,6 +74,10 @@ + + @@ -86,7 +88,8 @@ - + + @@ -122,38 +125,6 @@ - - - - - - - - - - - - - - - - - - diff --git a/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml b/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml index 3d12b639fb..cb5a6a658a 100644 --- a/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml +++ b/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml @@ -10,7 +10,6 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:viewModels="clr-namespace:NETworkManager.ViewModels" xmlns:settings="clr-namespace:NETworkManager.Settings;assembly=NETworkManager.Settings" - xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:wpfHelpers="clr-namespace:NETworkManager.Utilities.WPF;assembly=NETworkManager.Utilities.WPF" mc:Ignorable="d" MinHeight="200" d:DataContext="{d:DesignInstance viewModels:IPApiIPGeolocationWidgetViewModel}"> @@ -23,9 +22,7 @@ - - @@ -39,6 +36,7 @@ + @@ -79,6 +77,10 @@ + + @@ -89,10 +91,8 @@ - - - - + + @@ -226,55 +226,6 @@ Text="{Binding Result.Info.Mobile, Converter={StaticResource BooleanToStringConverter}}" /> - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index cddc46ede5..d65866b342 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -169,6 +169,7 @@ Release date: **xx.xx.2026** - Fixed one failed request (e.g. a short interruption of the connection or a proxy that rejects a large upload) ending the whole speed test. Like the official library, a failed request is skipped (a warning shows how many) and a request rate limited by Cloudflare (HTTP 429) is repeated up to three times. If all requests of a size fail, the larger sizes of the direction are skipped; the test only ends after three requests in a row without a response. [#3740](https://github.com/BornToBeRoot/NETworkManager/pull/3740) - Fixed the server of the speed test being empty at the start of a test or shown as `-/-, -/- (-/-)` when Cloudflare did not report it. It is shown as `-/-` like the ISP, with the full name in the tooltip. [#3740](https://github.com/BornToBeRoot/NETworkManager/pull/3740) - Fixed the sparkline of the speed test showing the first request twice (one point more than requests, the same value twice in the tooltip). [#3740](https://github.com/BornToBeRoot/NETworkManager/pull/3740) +- Fixed the IP geolocation widget showing no reason when ip-api.com could not be reached (e.g. no network connection), and the DNS resolver widget showing the English error text of .NET. Both show a translated message below their header (e.g. no response within 10 seconds or the HTTP status code), like the speed test, and a request fails after 10 seconds without a response instead of 100 seconds. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Status window** From 0a04c9748f70fa74d043c9b130956f46ee91eb4d Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:03:22 +0100 Subject: [PATCH 06/43] Fix: Dashboard: IP geolocation / DNS resolver refresh enabled right after the check (B5) Co-Authored-By: Claude Opus 5.5 --- .../IPApiDNSResolverWidgetViewModel.cs | 42 +++++++++------ .../IPApiIPGeolocationWidgetViewModel.cs | 52 +++++++++++-------- Website/docs/changelog/next-release.md | 1 + 3 files changed, 56 insertions(+), 39 deletions(-) diff --git a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs index 3029e8e3ca..24d3e3095e 100644 --- a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs @@ -143,27 +143,35 @@ private async Task CheckAsync() IsStatusMessageDisplayed = false; Result = null; - // Takes at least the refresh interval, so the reload animation is visible and the check can't be spammed - - // the request runs at the same time - var result = await TaskHelper.WithMinimumDurationAsync( - () => ScreenshotData.IsEnabled - ? Task.FromResult(ScreenshotData.CreateDNSResolverResult()) - : DNSResolverService.GetInstance().GetDNSResolverAsync(), - GlobalStaticConfiguration.ApplicationUIRefreshInterval); - - if (result.HasError) + try { - StatusMessage = WebRequestErrorMessage.Get(DNSResolverService.Host, DNSResolverService.RequestTimeout, - result.Error); - StatusMessageLevel = StatusLevel.Error; - IsStatusMessageDisplayed = true; + // Takes at least the refresh interval, so the reload animation is visible and the check can't be spammed - + // the request runs at the same time + var result = await TaskHelper.WithMinimumDurationAsync( + () => ScreenshotData.IsEnabled + ? Task.FromResult(ScreenshotData.CreateDNSResolverResult()) + : DNSResolverService.GetInstance().GetDNSResolverAsync(), + GlobalStaticConfiguration.ApplicationUIRefreshInterval); + + if (result.HasError) + { + StatusMessage = WebRequestErrorMessage.Get(DNSResolverService.Host, DNSResolverService.RequestTimeout, + result.Error); + StatusMessageLevel = StatusLevel.Error; + IsStatusMessageDisplayed = true; + } + else + { + Result = result; + } } - else + finally { - Result = result; - } + IsRunning = false; - IsRunning = false; + // Enable the refresh button (CanExecute is otherwise only evaluated on the next input) + CommandManager.InvalidateRequerySuggested(); + } } #endregion diff --git a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs index df44d477e6..ab7e2a240f 100644 --- a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs @@ -146,33 +146,41 @@ private async Task CheckAsync() IsStatusMessageDisplayed = false; Result = null; - // Takes at least the refresh interval, so the reload animation is visible and the check can't be spammed - - // the request runs at the same time - var result = await TaskHelper.WithMinimumDurationAsync( - () => ScreenshotData.IsEnabled - ? Task.FromResult(ScreenshotData.CreateIPGeolocationResult()) - : IPGeolocationService.GetInstance().GetIPGeolocationAsync(), - GlobalStaticConfiguration.ApplicationUIRefreshInterval); - - if (result.HasError) + try { - Log.Error($"ip-api.com error: {result.ErrorMessage}, error code: {result.ErrorCode}"); - - ShowStatusMessage(WebRequestErrorMessage.Get(IPGeolocationService.Host, - IPGeolocationService.RequestTimeout, result.Error), StatusLevel.Error); + // Takes at least the refresh interval, so the reload animation is visible and the check can't be spammed - + // the request runs at the same time + var result = await TaskHelper.WithMinimumDurationAsync( + () => ScreenshotData.IsEnabled + ? Task.FromResult(ScreenshotData.CreateIPGeolocationResult()) + : IPGeolocationService.GetInstance().GetIPGeolocationAsync(), + GlobalStaticConfiguration.ApplicationUIRefreshInterval); + + if (result.HasError) + { + Log.Error($"ip-api.com error: {result.ErrorMessage}, error code: {result.ErrorCode}"); + + ShowStatusMessage(WebRequestErrorMessage.Get(IPGeolocationService.Host, + IPGeolocationService.RequestTimeout, result.Error), StatusLevel.Error); + } + else if (result.RateLimitIsReached) + { + Log.Warn($"ip-api.com rate limit reached. Try again in {result.RateLimitRemainingTime} seconds."); + + ShowStatusMessage(Strings.IPApiRateLimitMessage, StatusLevel.Warning); + } + else + { + Result = result; + } } - else if (result.RateLimitIsReached) + finally { - Log.Warn($"ip-api.com rate limit reached. Try again in {result.RateLimitRemainingTime} seconds."); + IsRunning = false; - ShowStatusMessage(Strings.IPApiRateLimitMessage, StatusLevel.Warning); - } - else - { - Result = result; + // Enable the refresh button (CanExecute is otherwise only evaluated on the next input) + CommandManager.InvalidateRequerySuggested(); } - - IsRunning = false; } private void ShowStatusMessage(string message, StatusLevel level) diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index d65866b342..4b3525d135 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -170,6 +170,7 @@ Release date: **xx.xx.2026** - Fixed the server of the speed test being empty at the start of a test or shown as `-/-, -/- (-/-)` when Cloudflare did not report it. It is shown as `-/-` like the ISP, with the full name in the tooltip. [#3740](https://github.com/BornToBeRoot/NETworkManager/pull/3740) - Fixed the sparkline of the speed test showing the first request twice (one point more than requests, the same value twice in the tooltip). [#3740](https://github.com/BornToBeRoot/NETworkManager/pull/3740) - Fixed the IP geolocation widget showing no reason when ip-api.com could not be reached (e.g. no network connection), and the DNS resolver widget showing the English error text of .NET. Both show a translated message below their header (e.g. no response within 10 seconds or the HTTP status code), like the speed test, and a request fails after 10 seconds without a response instead of 100 seconds. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed the refresh button of the IP geolocation and DNS resolver widgets staying disabled after a check until the mouse was moved or a key was pressed. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Status window** From d2a92e04332989c59dc0f9609730233f7f450fd6 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:03:53 +0100 Subject: [PATCH 07/43] Fix: Dashboard: DNS resolver errors logged (C3) Co-Authored-By: Claude Opus 5.5 --- .../ViewModels/IPApiDNSResolverWidgetViewModel.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs index 24d3e3095e..3dbd5635a5 100644 --- a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs @@ -1,5 +1,6 @@ using System.Threading.Tasks; using System.Windows.Input; +using log4net; using NETworkManager.Controls; using NETworkManager.Models.IPApi; using NETworkManager.Settings; @@ -14,6 +15,8 @@ public class IPApiDNSResolverWidgetViewModel : ViewModelBase { #region Variables + private static readonly ILog Log = LogManager.GetLogger(typeof(IPApiDNSResolverWidgetViewModel)); + /// /// Gets or sets a value indicating whether the check is running. /// @@ -155,6 +158,8 @@ private async Task CheckAsync() if (result.HasError) { + Log.Error($"edns.ip-api.com error: {result.ErrorMessage}, error code: {result.ErrorCode}"); + StatusMessage = WebRequestErrorMessage.Get(DNSResolverService.Host, DNSResolverService.RequestTimeout, result.Error); StatusMessageLevel = StatusLevel.Error; From 0e38093787072b6771980b3006d40fb6cdd53e0e Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:05:22 +0100 Subject: [PATCH 08/43] Fix: Dashboard: IP geolocation / DNS resolver checked again after a network change (B3) Co-Authored-By: Claude Opus 5.5 --- .../IPApiDNSResolverWidgetViewModel.cs | 8 +++- .../IPApiIPGeolocationWidgetViewModel.cs | 8 +++- .../Views/DashboardView.xaml.cs | 48 +++++++++++-------- .../Views/IPApiDNSResolverWidgetView.xaml.cs | 5 ++ .../IPApiIPGeolocationWidgetView.xaml.cs | 5 ++ Website/docs/changelog/next-release.md | 1 + 6 files changed, 52 insertions(+), 23 deletions(-) diff --git a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs index 3dbd5635a5..c64c75cd23 100644 --- a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs @@ -126,10 +126,14 @@ private void LoadSettings() #region Methods /// - /// Checks the DNS resolver. + /// Checks the DNS resolver (also called by the dashboard, e.g. after a network change). /// - private void Check() + public void Check() { + // Already checking, e.g. the network changed right after the widget was created + if (IsRunning) + return; + _ = CheckAsync(); } diff --git a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs index ab7e2a240f..2a7b7461dc 100644 --- a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs @@ -126,10 +126,14 @@ private void LoadSettings() #region Methods /// - /// Checks the IP geolocation. + /// Checks the IP geolocation (also called by the dashboard, e.g. after a network change). /// - private void Check() + public void Check() { + // Already checking, e.g. the network changed right after the widget was created + if (IsRunning) + return; + _ = CheckAsync(); } diff --git a/Source/NETworkManager/Views/DashboardView.xaml.cs b/Source/NETworkManager/Views/DashboardView.xaml.cs index 655c74fdee..ac24a8cdd3 100644 --- a/Source/NETworkManager/Views/DashboardView.xaml.cs +++ b/Source/NETworkManager/Views/DashboardView.xaml.cs @@ -25,13 +25,12 @@ public partial class DashboardView private bool _isViewVisible = true; /// - /// The network or a setting of the network connection check changed while the dashboard was hidden: check again - /// when it is shown. + /// The network or a setting of a check changed while the dashboard was hidden: check again when it is shown. /// private bool _isOutdated; /// - /// Start of the last network connection check, see . + /// Start of the last check, see . /// private DateTime _lastCheck; @@ -46,8 +45,9 @@ public DashboardView() // The settings are changed while the dashboard is hidden (settings view) - check again when it is shown SettingsManager.Current.PropertyChanged += SettingsManager_PropertyChanged; - // Check network connection on first open. Later re-opens are covered by OnViewVisible(). - CheckNetworkConnection(); + // Check on first open (the IP API widgets are already checking since they were created). Later re-opens are + // covered by OnViewVisible(). + CheckWidgets(); } public void OnViewVisible() @@ -59,7 +59,7 @@ public void OnViewVisible() // The widgets may have been shown or hidden in the settings ApplyWidgetSettings(); - CheckNetworkConnectionIfOutdated(); + CheckWidgetsIfOutdated(); } /// @@ -68,7 +68,7 @@ public void OnViewVisible() public void OnMainWindowShown() { if (_isViewVisible) - CheckNetworkConnectionIfOutdated(); + CheckWidgetsIfOutdated(); } public void OnViewHide() @@ -86,32 +86,42 @@ public void OnViewHide() public void OnNetworkChanged(bool isMainWindowShown) { if (_isViewVisible && isMainWindowShown) - CheckNetworkConnection(); + CheckWidgets(); else _isOutdated = true; } /// - /// Checks the network connection again if something changed, or if the last check is older than the recheck - /// interval (e.g. the public IP address may have changed) - not on every switch between the applications. + /// Checks the widgets again if something changed, or if the last check is older than the recheck interval (e.g. + /// the public IP address may have changed) - not on every switch between the applications. /// - private void CheckNetworkConnectionIfOutdated() + private void CheckWidgetsIfOutdated() { if (_isOutdated || DateTime.Now - _lastCheck >= GlobalStaticConfiguration.Dashboard_RecheckInterval) - CheckNetworkConnection(); + CheckWidgets(); } - private void CheckNetworkConnection() + /// + /// Checks the network connection and the IP API widgets (the public IP address, and with it the IP geolocation + /// and the DNS resolver, may have changed). + /// + private void CheckWidgets() { - // Hidden or not created yet: checked when it is shown (a changed setting marks the data as outdated, the widget - // is created in OnViewVisible) - if (!SettingsManager.Current.Dashboard_ShowNetworkConnectionWidget || _networkConnectionWidgetView == null) - return; - _isOutdated = false; _lastCheck = DateTime.Now; - _networkConnectionWidgetView.Check(); + // Hidden or not created yet: checked when it is shown (a changed setting marks the data as outdated, the widget + // is created in OnViewVisible). A widget whose check is disabled sends no request. + var settings = SettingsManager.Current; + + if (settings.Dashboard_ShowNetworkConnectionWidget) + _networkConnectionWidgetView?.Check(); + + if (settings.Dashboard_ShowIPGeolocationWidget) + _ipApiIPGeolocationWidgetView?.Check(); + + if (settings.Dashboard_ShowDNSResolverWidget) + _ipApiDNSResolverWidgetView?.Check(); } /// diff --git a/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml.cs b/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml.cs index ed93bf424d..8f1165c5d3 100644 --- a/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml.cs +++ b/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml.cs @@ -13,4 +13,9 @@ public IPApiDNSResolverWidgetView() DataContext = _viewModel; } + public void Check() + { + _viewModel.Check(); + } + } \ No newline at end of file diff --git a/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml.cs b/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml.cs index 2e6224f830..eeed2adb6a 100644 --- a/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml.cs +++ b/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml.cs @@ -12,4 +12,9 @@ public IPApiIPGeolocationWidgetView() DataContext = _viewModel; } + public void Check() + { + _viewModel.Check(); + } + } \ No newline at end of file diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index 4b3525d135..98d8a6c128 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -171,6 +171,7 @@ Release date: **xx.xx.2026** - Fixed the sparkline of the speed test showing the first request twice (one point more than requests, the same value twice in the tooltip). [#3740](https://github.com/BornToBeRoot/NETworkManager/pull/3740) - Fixed the IP geolocation widget showing no reason when ip-api.com could not be reached (e.g. no network connection), and the DNS resolver widget showing the English error text of .NET. Both show a translated message below their header (e.g. no response within 10 seconds or the HTTP status code), like the speed test, and a request fails after 10 seconds without a response instead of 100 seconds. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the refresh button of the IP geolocation and DNS resolver widgets staying disabled after a check until the mouse was moved or a key was pressed. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed the IP geolocation and DNS resolver widgets showing old values after the network changed (e.g. a VPN connected: the network connection showed the new public IP address, the IP geolocation the old one). They are checked again with the network connection: after a network change, and when the dashboard is shown again and the last check is at least 60 seconds old. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Status window** From c71aa52f8e51dde67c17a3cb4d83178f4bba2c57 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:12:29 +0100 Subject: [PATCH 09/43] Fix: Dashboard: IP geolocation / DNS resolver checked after the check was enabled (B2) Co-Authored-By: Claude Opus 5.5 --- Source/NETworkManager/Views/DashboardView.xaml.cs | 15 ++++++++++----- Website/docs/changelog/next-release.md | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Source/NETworkManager/Views/DashboardView.xaml.cs b/Source/NETworkManager/Views/DashboardView.xaml.cs index ac24a8cdd3..bfcec1a17d 100644 --- a/Source/NETworkManager/Views/DashboardView.xaml.cs +++ b/Source/NETworkManager/Views/DashboardView.xaml.cs @@ -185,10 +185,11 @@ private void ApplyWidgetSettings() } /// - /// Settings used by the network connection check: a change marks it as outdated (checked when the dashboard is - /// shown again). Other dashboard settings (e.g. the other widgets) keep the recheck interval. + /// Settings used by the checks: a change marks them as outdated (checked when the dashboard is shown again, e.g. + /// the IP geolocation right after its check was enabled). Other dashboard settings (e.g. the speed test widget) + /// keep the recheck interval. /// - private static readonly HashSet NetworkConnectionSettings = + private static readonly HashSet CheckSettings = [ nameof(SettingsInfo.Dashboard_PublicIPv4Address), nameof(SettingsInfo.Dashboard_PublicIPv6Address), @@ -197,12 +198,16 @@ private void ApplyWidgetSettings() nameof(SettingsInfo.Dashboard_CustomPublicIPv4AddressAPI), nameof(SettingsInfo.Dashboard_UseCustomPublicIPv6AddressAPI), nameof(SettingsInfo.Dashboard_CustomPublicIPv6AddressAPI), - nameof(SettingsInfo.Dashboard_ShowNetworkConnectionWidget) + nameof(SettingsInfo.Dashboard_ShowNetworkConnectionWidget), + nameof(SettingsInfo.Dashboard_CheckIPApiIPGeolocation), + nameof(SettingsInfo.Dashboard_ShowIPGeolocationWidget), + nameof(SettingsInfo.Dashboard_CheckIPApiDNSResolver), + nameof(SettingsInfo.Dashboard_ShowDNSResolverWidget) ]; private void SettingsManager_PropertyChanged(object sender, PropertyChangedEventArgs e) { - if (e.PropertyName != null && NetworkConnectionSettings.Contains(e.PropertyName)) + if (e.PropertyName != null && CheckSettings.Contains(e.PropertyName)) _isOutdated = true; // A hidden speed test widget doesn't measure (no data is transferred in the background): cancel it right away, diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index 98d8a6c128..7a0c575629 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -172,6 +172,7 @@ Release date: **xx.xx.2026** - Fixed the IP geolocation widget showing no reason when ip-api.com could not be reached (e.g. no network connection), and the DNS resolver widget showing the English error text of .NET. Both show a translated message below their header (e.g. no response within 10 seconds or the HTTP status code), like the speed test, and a request fails after 10 seconds without a response instead of 100 seconds. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the refresh button of the IP geolocation and DNS resolver widgets staying disabled after a check until the mouse was moved or a key was pressed. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the IP geolocation and DNS resolver widgets showing old values after the network changed (e.g. a VPN connected: the network connection showed the new public IP address, the IP geolocation the old one). They are checked again with the network connection: after a network change, and when the dashboard is shown again and the last check is at least 60 seconds old. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed the IP geolocation and DNS resolver widgets showing an empty result (and the error texts on top of it) after their check was enabled in the settings, until the refresh button was clicked. They are checked when the dashboard is shown again, also after the widget was shown again. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Status window** From 40e17c7450117f739604753928d7cc4d7d670921 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:20:25 +0100 Subject: [PATCH 10/43] Fix: IP API: Time left of the rate limit (B7) Co-Authored-By: Claude Opus 5.5 --- .../IPApi/IPGeolocationService.cs | 31 ++++++++++++++-- .../IPApi/IPGeolocationServiceTests.cs | 36 +++++++++++++++++++ Website/docs/changelog/next-release.md | 1 + 3 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs diff --git a/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs b/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs index d41e9eff6b..c4265039f6 100644 --- a/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs +++ b/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs @@ -69,7 +69,8 @@ public class IPGeolocationService : SingletonBase public async Task GetIPGeolocationAsync(string ipAddressOrFqdn = "") { if (IsInRateLimit()) - return new IPGeolocationResult(true, _rateLimitRemainingTime); + return new IPGeolocationResult(true, + GetRemainingSeconds(_rateLimitLastReached, _rateLimitRemainingTime, DateTime.Now)); // If the url is empty, the current IP address from which the request is made is used. var url = $"{BaseUrl}/{ipAddressOrFqdn}?fields={Fields}"; @@ -114,6 +115,32 @@ public async Task GetIPGeolocationAsync(string ipAddressOrF } } + /// + /// End of the rate limit: the time window (X-Ttl) plus one second of margin. + /// + /// Time when the rate limit was reached. + /// Seconds until the time window resets (X-Ttl, 60 after HTTP 429). + /// Time from which requests are sent again. + private static DateTime GetRateLimitEnd(DateTime lastReached, int remainingTime) + { + return lastReached.AddSeconds(remainingTime + 1); + } + + /// + /// Seconds until requests are sent again (shown as "try again in ... seconds"), counting down while the rate + /// limit is reached instead of the whole time window. + /// + /// Time when the rate limit was reached. + /// Seconds until the time window resets (X-Ttl, 60 after HTTP 429). + /// Current time. + /// Seconds, rounded up, at least 1. + public static int GetRemainingSeconds(DateTime lastReached, int remainingTime, DateTime now) + { + var seconds = (int)Math.Ceiling((GetRateLimitEnd(lastReached, remainingTime) - now).TotalSeconds); + + return Math.Max(1, seconds); + } + /// /// Checks whether the rate limit is reached. /// @@ -128,7 +155,7 @@ private bool IsInRateLimit() var lastReached = _rateLimitLastReached; // We are still in the rate limit - if (lastReached.AddSeconds(_rateLimitRemainingTime + 1) >= DateTime.Now) + if (GetRateLimitEnd(lastReached, _rateLimitRemainingTime) >= DateTime.Now) return true; // We are not in the rate limit anymore diff --git a/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs b/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs new file mode 100644 index 0000000000..0c9d8612c4 --- /dev/null +++ b/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs @@ -0,0 +1,36 @@ +using System; +using NETworkManager.Models.IPApi; +using Xunit; + +namespace NETworkManager.Tests.IPApi; + +public class IPGeolocationServiceTests +{ + private static readonly DateTime LastReached = new(2026, 11, 26, 12, 0, 0); + + [Fact] + public void RemainingSecondsRightAfterTheRateLimitIsTheWindowWithMargin() + { + Assert.Equal(61, IPGeolocationService.GetRemainingSeconds(LastReached, 60, LastReached)); + } + + [Fact] + public void RemainingSecondsCountDown() + { + // Not the whole window again ("try again in 60 seconds" 50 seconds later) + Assert.Equal(11, IPGeolocationService.GetRemainingSeconds(LastReached, 60, LastReached.AddSeconds(50))); + } + + [Fact] + public void RemainingSecondsAreRoundedUp() + { + Assert.Equal(2, IPGeolocationService.GetRemainingSeconds(LastReached, 10, LastReached.AddSeconds(9.5))); + } + + [Fact] + public void RemainingSecondsAreAtLeastOne() + { + Assert.Equal(1, IPGeolocationService.GetRemainingSeconds(LastReached, 10, LastReached.AddSeconds(11))); + Assert.Equal(1, IPGeolocationService.GetRemainingSeconds(LastReached, 10, LastReached.AddMinutes(5))); + } +} diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index 7a0c575629..107c39db3f 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -186,6 +186,7 @@ Release date: **xx.xx.2026** - Fixed the tab getting stuck (query disabled, input read-only, progress bar running) after an error or when the rate limit of ip-api.com was reached, until the tab was closed. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed a query waiting up to 100 seconds when ip-api.com did not respond (e.g. a firewall that drops the request). It fails after 10 seconds. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed "Rate limit reached! Try again in ... seconds" always showing the whole time window of ip-api.com (e.g. 60 seconds) instead of the time that is left. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Traceroute** From f79aa6ca22f994b3442829029fc8352bb6361943 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:21:19 +0100 Subject: [PATCH 11/43] Fix: IP API: Result used without the rate limit headers (B8) Co-Authored-By: Claude Opus 5.5 --- .../IPApi/IPGeolocationResult.cs | 18 +-------- .../IPApi/IPGeolocationService.cs | 40 ++++++++++++------- .../IPApi/IPGeolocationServiceTests.cs | 35 ++++++++++++++++ Website/docs/changelog/next-release.md | 3 ++ 4 files changed, 64 insertions(+), 32 deletions(-) diff --git a/Source/NETworkManager.Models/IPApi/IPGeolocationResult.cs b/Source/NETworkManager.Models/IPApi/IPGeolocationResult.cs index 97b025ddd3..c103957528 100644 --- a/Source/NETworkManager.Models/IPApi/IPGeolocationResult.cs +++ b/Source/NETworkManager.Models/IPApi/IPGeolocationResult.cs @@ -36,22 +36,6 @@ public IPGeolocationResult(bool isRateLimitReached, int rateLimitRemainingTime) RateLimitRemainingTime = rateLimitRemainingTime; } - /// - /// Create a new instance of with an error message and an error code. - /// - /// Indicates if the IP geolocation information retrieval has failed. - /// Error message if the IP geolocation information retrieval has failed. - /// - /// Error code if the IP geolocation information retrieval has failed (or -1 if exception was - /// thrown). - /// - public IPGeolocationResult(bool hasError, string errorMessage, int errorCode) - { - HasError = hasError; - ErrorMessage = errorMessage; - ErrorCode = errorCode; - } - /// /// Create a new instance of for a failed request. /// @@ -97,7 +81,7 @@ public IPGeolocationResult(Exception error) public int ErrorCode { get; set; } /// - /// Error of the request, mapped to a localized message by the view model (null if the answer was invalid). + /// Error of the request, mapped to a localized message by the view model. /// public Exception Error { get; set; } } \ No newline at end of file diff --git a/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs b/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs index c4265039f6..a962d9e088 100644 --- a/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs +++ b/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs @@ -3,6 +3,7 @@ using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; +using log4net; using NETworkManager.Utilities; using Newtonsoft.Json; @@ -14,6 +15,8 @@ namespace NETworkManager.Models.IPApi; /// public class IPGeolocationService : SingletonBase { + private static readonly ILog Log = LogManager.GetLogger(typeof(IPGeolocationService)); + /// /// Base URL fo the ip-api free endpoint. /// @@ -82,11 +85,10 @@ public async Task GetIPGeolocationAsync(string ipAddressOrF // Check if the request was successful. if (response.IsSuccessStatusCode) { - // Update rate limit values. + // Update rate limit values. Without them (e.g. removed by a proxy) the answer is still used, the last + // values are kept (a 429 still stops the requests) if (!UpdateRateLimit(response.Headers)) - return new IPGeolocationResult(true, - "The rate limit values couldn't be extracted from the http header. The request was probably corrupted. Try again in a few seconds.", - -1); + Log.Warn("The rate limit headers (X-Rl, X-Ttl) of ip-api.com are missing or invalid."); var json = await response.Content.ReadAsStringAsync(); var info = JsonConvert.DeserializeObject(json); @@ -164,6 +166,24 @@ private bool IsInRateLimit() return false; } + /// + /// Reads the rate limit from the headers of the response. + /// + /// Headers of the response. + /// Requests left in the time window (X-Rl). + /// Seconds until the time window resets (X-Ttl). + /// true if both headers are present and valid. + public static bool TryParseRateLimit(HttpHeaders headers, out int remainingRequests, out int remainingTime) + { + remainingRequests = 0; + remainingTime = 0; + + return headers.TryGetValues("X-Rl", out var xRl) && + int.TryParse(xRl.FirstOrDefault(), out remainingRequests) && + headers.TryGetValues("X-Ttl", out var xTtl) && + int.TryParse(xTtl.FirstOrDefault(), out remainingTime); + } + /// /// Updates the rate limit values. /// @@ -171,17 +191,7 @@ private bool IsInRateLimit() /// True if the update was successful, false otherwise. private bool UpdateRateLimit(HttpHeaders headers) { - // Parse header data - if (!headers.TryGetValues("X-Rl", out var xRl)) - return false; - - if (!int.TryParse(xRl.ToArray()[0], out var remainingRequests)) - return false; - - if (!headers.TryGetValues("X-Ttl", out var xTtl)) - return false; - - if (!int.TryParse(xTtl.ToArray()[0], out var remainingTime)) + if (!TryParseRateLimit(headers, out var remainingRequests, out var remainingTime)) return false; _rateLimitRemainingTime = remainingTime; diff --git a/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs b/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs index 0c9d8612c4..6707e2d230 100644 --- a/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs +++ b/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs @@ -1,4 +1,5 @@ using System; +using System.Net.Http; using NETworkManager.Models.IPApi; using Xunit; @@ -33,4 +34,38 @@ public void RemainingSecondsAreAtLeastOne() Assert.Equal(1, IPGeolocationService.GetRemainingSeconds(LastReached, 10, LastReached.AddSeconds(11))); Assert.Equal(1, IPGeolocationService.GetRemainingSeconds(LastReached, 10, LastReached.AddMinutes(5))); } + + private static HttpResponseMessage CreateResponse(string xRl, string xTtl) + { + var response = new HttpResponseMessage(); + + if (xRl != null) + response.Headers.Add("X-Rl", xRl); + + if (xTtl != null) + response.Headers.Add("X-Ttl", xTtl); + + return response; + } + + [Fact] + public void RateLimitIsReadFromTheHeaders() + { + Assert.True(IPGeolocationService.TryParseRateLimit(CreateResponse("44", "59").Headers, + out var remainingRequests, out var remainingTime)); + Assert.Equal(44, remainingRequests); + Assert.Equal(59, remainingTime); + } + + [Theory] + [InlineData(null, "59")] + [InlineData("44", null)] + [InlineData(null, null)] + [InlineData("many", "59")] + [InlineData("44", "")] + public void RateLimitWithoutValidHeadersIsNotRead(string xRl, string xTtl) + { + // e.g. removed by a proxy: the answer is used anyway + Assert.False(IPGeolocationService.TryParseRateLimit(CreateResponse(xRl, xTtl).Headers, out _, out _)); + } } diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index 107c39db3f..cdcd2b28bb 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -173,6 +173,7 @@ Release date: **xx.xx.2026** - Fixed the refresh button of the IP geolocation and DNS resolver widgets staying disabled after a check until the mouse was moved or a key was pressed. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the IP geolocation and DNS resolver widgets showing old values after the network changed (e.g. a VPN connected: the network connection showed the new public IP address, the IP geolocation the old one). They are checked again with the network connection: after a network change, and when the dashboard is shown again and the last check is at least 60 seconds old. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the IP geolocation and DNS resolver widgets showing an empty result (and the error texts on top of it) after their check was enabled in the settings, until the refresh button was clicked. They are checked when the dashboard is shown again, also after the widget was shown again. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed the IP geolocation widget failing when a proxy removed the rate limit headers of ip-api.com. The result is shown. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Status window** @@ -187,10 +188,12 @@ Release date: **xx.xx.2026** - Fixed the tab getting stuck (query disabled, input read-only, progress bar running) after an error or when the rate limit of ip-api.com was reached, until the tab was closed. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed a query waiting up to 100 seconds when ip-api.com did not respond (e.g. a firewall that drops the request). It fails after 10 seconds. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed "Rate limit reached! Try again in ... seconds" always showing the whole time window of ip-api.com (e.g. 60 seconds) instead of the time that is left. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed every query failing with "The rate limit values couldn't be extracted from the http header..." when a proxy removed the rate limit headers of ip-api.com. The result is shown, the rate limit is still detected by ip-api.com's answer (HTTP 429). [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Traceroute** - Fixed the traceroute waiting up to 100 seconds per hop when the IP geolocation is enabled and ip-api.com did not respond (e.g. a firewall that drops the request). The geolocation of a hop fails after 10 seconds. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed the IP geolocation of every hop failing with "The rate limit values couldn't be extracted from the http header..." when a proxy removed the rate limit headers of ip-api.com. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) ## Dependencies, Refactoring & Documentation From cb81258ed4b0df690e350d8cae19c7dfed4bdfc3 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:31:24 +0100 Subject: [PATCH 12/43] Fix: IP API: Empty response is an error (B9) Co-Authored-By: Claude Opus 5.5 --- .../IPApi/DNSResolverService.cs | 21 ++++++++-- .../IPApi/IPGeolocationService.cs | 21 ++++++++-- .../IPApi/DNSResolverServiceTests.cs | 42 +++++++++++++++++++ .../IPApi/IPGeolocationServiceTests.cs | 20 +++++++++ Website/docs/changelog/next-release.md | 3 ++ 5 files changed, 99 insertions(+), 8 deletions(-) create mode 100644 Source/NETworkManager.Tests/IPApi/DNSResolverServiceTests.cs diff --git a/Source/NETworkManager.Models/IPApi/DNSResolverService.cs b/Source/NETworkManager.Models/IPApi/DNSResolverService.cs index c172d9b2c6..13425083a5 100644 --- a/Source/NETworkManager.Models/IPApi/DNSResolverService.cs +++ b/Source/NETworkManager.Models/IPApi/DNSResolverService.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using System.Net.Http; using System.Threading.Tasks; using NETworkManager.Utilities; @@ -42,10 +43,7 @@ public async Task GetDNSResolverAsync() if (response.IsSuccessStatusCode) { - var json = await response.Content.ReadAsStringAsync(); - var info = JsonConvert.DeserializeObject(json); - - return new DNSResolverResult(DNSResolverInfo.Parse(info)); + return ParseResponse(await response.Content.ReadAsStringAsync()); } return new DNSResolverResult(new HttpRequestException(response.ReasonPhrase, null, response.StatusCode)); @@ -55,4 +53,19 @@ public async Task GetDNSResolverAsync() return new DNSResolverResult(ex); } } + + /// + /// Parses the answer of the API. + /// + /// Body of the answer. + /// DNS resolver information, an error if the body is empty (e.g. from a proxy or a captive portal). + /// The body is not JSON. + public static DNSResolverResult ParseResponse(string json) + { + var info = JsonConvert.DeserializeObject(json); + + return info == null + ? new DNSResolverResult(new InvalidDataException("The response of the API is empty.")) + : new DNSResolverResult(DNSResolverInfo.Parse(info)); + } } \ No newline at end of file diff --git a/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs b/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs index a962d9e088..42422f218d 100644 --- a/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs +++ b/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using System.Linq; using System.Net.Http; using System.Net.Http.Headers; @@ -90,10 +91,7 @@ public async Task GetIPGeolocationAsync(string ipAddressOrF if (!UpdateRateLimit(response.Headers)) Log.Warn("The rate limit headers (X-Rl, X-Ttl) of ip-api.com are missing or invalid."); - var json = await response.Content.ReadAsStringAsync(); - var info = JsonConvert.DeserializeObject(json); - - return new IPGeolocationResult(info); + return ParseResponse(await response.Content.ReadAsStringAsync()); } // Consider the request as failed if the status code is not successful or 429. @@ -117,6 +115,21 @@ public async Task GetIPGeolocationAsync(string ipAddressOrF } } + /// + /// Parses the answer of the API. + /// + /// Body of the answer. + /// IP geolocation information, an error if the body is empty (e.g. from a proxy or a captive portal). + /// The body is not JSON. + public static IPGeolocationResult ParseResponse(string json) + { + var info = JsonConvert.DeserializeObject(json); + + return info == null + ? new IPGeolocationResult(new InvalidDataException("The response of the API is empty.")) + : new IPGeolocationResult(info); + } + /// /// End of the rate limit: the time window (X-Ttl) plus one second of margin. /// diff --git a/Source/NETworkManager.Tests/IPApi/DNSResolverServiceTests.cs b/Source/NETworkManager.Tests/IPApi/DNSResolverServiceTests.cs new file mode 100644 index 0000000000..906d09e7ba --- /dev/null +++ b/Source/NETworkManager.Tests/IPApi/DNSResolverServiceTests.cs @@ -0,0 +1,42 @@ +using NETworkManager.Models.IPApi; +using Xunit; + +namespace NETworkManager.Tests.IPApi; + +public class DNSResolverServiceTests +{ + [Fact] + public void ResponseIsParsed() + { + var result = DNSResolverService.ParseResponse( + "{\"dns\":{\"ip\":\"198.51.100.53\",\"geo\":\"Germany - Example ISP\"},\"edns\":{\"ip\":\"203.0.113.0\",\"geo\":\"Germany - Example ISP\"}}"); + + Assert.False(result.HasError); + Assert.Equal("198.51.100.53", result.Info.DnsIp); + Assert.Equal("Germany - Example ISP", result.Info.DnsGeo); + Assert.Equal("203.0.113.0", result.Info.EdnsIp); + } + + [Fact] + public void ResponseWithoutEDNSIsParsed() + { + // The resolver doesn't send the client subnet + var result = DNSResolverService.ParseResponse("{\"dns\":{\"ip\":\"198.51.100.53\",\"geo\":\"Germany\"}}"); + + Assert.False(result.HasError); + Assert.Equal("198.51.100.53", result.Info.DnsIp); + Assert.Null(result.Info.EdnsIp); + Assert.Null(result.Info.EdnsGeo); + } + + [Theory] + [InlineData("")] + [InlineData("null")] + public void EmptyResponseIsAnError(string json) + { + var result = DNSResolverService.ParseResponse(json); + + Assert.True(result.HasError); + Assert.Null(result.Info); + } +} diff --git a/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs b/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs index 6707e2d230..cd0cd47a4d 100644 --- a/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs +++ b/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs @@ -35,6 +35,26 @@ public void RemainingSecondsAreAtLeastOne() Assert.Equal(1, IPGeolocationService.GetRemainingSeconds(LastReached, 10, LastReached.AddMinutes(5))); } + [Fact] + public void ResponseIsParsed() + { + var result = IPGeolocationService.ParseResponse( + "{\"status\":\"success\",\"country\":\"Germany\",\"countryCode\":\"DE\",\"offset\":3600,\"query\":\"203.0.113.10\"}"); + + Assert.False(result.HasError); + Assert.Equal("Germany", result.Info.Country); + Assert.Equal(3600, result.Info.Offset); + Assert.Equal("203.0.113.10", result.Info.Query); + } + + [Theory] + [InlineData("")] + [InlineData("null")] + public void EmptyResponseIsAnError(string json) + { + Assert.True(IPGeolocationService.ParseResponse(json).HasError); + } + private static HttpResponseMessage CreateResponse(string xRl, string xTtl) { var response = new HttpResponseMessage(); diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index cdcd2b28bb..fe9e903ee7 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -174,6 +174,7 @@ Release date: **xx.xx.2026** - Fixed the IP geolocation and DNS resolver widgets showing old values after the network changed (e.g. a VPN connected: the network connection showed the new public IP address, the IP geolocation the old one). They are checked again with the network connection: after a network change, and when the dashboard is shown again and the last check is at least 60 seconds old. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the IP geolocation and DNS resolver widgets showing an empty result (and the error texts on top of it) after their check was enabled in the settings, until the refresh button was clicked. They are checked when the dashboard is shown again, also after the widget was shown again. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the IP geolocation widget failing when a proxy removed the rate limit headers of ip-api.com. The result is shown. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed the DNS resolver widget showing "Object reference not set to an instance of an object" when edns.ip-api.com answered with an empty response (e.g. a proxy). An empty response of ip-api.com is shown as an error in both widgets. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Status window** @@ -189,11 +190,13 @@ Release date: **xx.xx.2026** - Fixed a query waiting up to 100 seconds when ip-api.com did not respond (e.g. a firewall that drops the request). It fails after 10 seconds. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed "Rate limit reached! Try again in ... seconds" always showing the whole time window of ip-api.com (e.g. 60 seconds) instead of the time that is left. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed every query failing with "The rate limit values couldn't be extracted from the http header..." when a proxy removed the rate limit headers of ip-api.com. The result is shown, the rate limit is still detected by ip-api.com's answer (HTTP 429). [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed an empty response of ip-api.com (e.g. from a proxy) being shown as an empty result instead of an error. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Traceroute** - Fixed the traceroute waiting up to 100 seconds per hop when the IP geolocation is enabled and ip-api.com did not respond (e.g. a firewall that drops the request). The geolocation of a hop fails after 10 seconds. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the IP geolocation of every hop failing with "The rate limit values couldn't be extracted from the http header..." when a proxy removed the rate limit headers of ip-api.com. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed an empty response of ip-api.com (e.g. from a proxy) being shown as an empty IP geolocation of the hop instead of an error. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) ## Dependencies, Refactoring & Documentation From 2b9b36b57726c375774c1ff00253a3119b7dfd77 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:31:58 +0100 Subject: [PATCH 13/43] Fix: IP API: Request URL without double slash (B10) Co-Authored-By: Claude Opus 5.5 --- .../IPApi/IPGeolocationService.cs | 14 ++++++++++++-- .../IPApi/IPGeolocationServiceTests.cs | 10 ++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs b/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs index 42422f218d..59a749fa08 100644 --- a/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs +++ b/Source/NETworkManager.Models/IPApi/IPGeolocationService.cs @@ -76,8 +76,7 @@ public async Task GetIPGeolocationAsync(string ipAddressOrF return new IPGeolocationResult(true, GetRemainingSeconds(_rateLimitLastReached, _rateLimitRemainingTime, DateTime.Now)); - // If the url is empty, the current IP address from which the request is made is used. - var url = $"{BaseUrl}/{ipAddressOrFqdn}?fields={Fields}"; + var url = GetUrl(ipAddressOrFqdn); try { @@ -115,6 +114,17 @@ public async Task GetIPGeolocationAsync(string ipAddressOrF } } + /// + /// URL of the request (http://ip-api.com/json/{query}?fields=...). + /// + /// IP address or host name, empty for the public IP address of the computer. + /// URL. + public static string GetUrl(string ipAddressOrFqdn) + { + // The base URL ends with a slash (no "json//" for the own IP address) + return $"{BaseUrl}{ipAddressOrFqdn}?fields={Fields}"; + } + /// /// Parses the answer of the API. /// diff --git a/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs b/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs index cd0cd47a4d..1f2aaeacda 100644 --- a/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs +++ b/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs @@ -35,6 +35,16 @@ public void RemainingSecondsAreAtLeastOne() Assert.Equal(1, IPGeolocationService.GetRemainingSeconds(LastReached, 10, LastReached.AddMinutes(5))); } + [Theory] + [InlineData("", "http://ip-api.com/json/?fields=")] + [InlineData("8.8.8.8", "http://ip-api.com/json/8.8.8.8?fields=")] + [InlineData("2001:db8::1", "http://ip-api.com/json/2001:db8::1?fields=")] + [InlineData("example.com", "http://ip-api.com/json/example.com?fields=")] + public void UrlHasOneSlashBeforeTheQuery(string query, string expectedStart) + { + Assert.StartsWith(expectedStart, IPGeolocationService.GetUrl(query)); + } + [Fact] public void ResponseIsParsed() { From b19d62429ee03867448145795952a4d63b461838 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:33:17 +0100 Subject: [PATCH 14/43] Fix: IP API: Offset as UTC+hh:mm, no empty brackets (B6) Co-Authored-By: Claude Opus 5.5 --- .../IPApi/IPGeolocationInfo.cs | 55 ++++++++++++++++++- .../IPApi/IPGeolocationInfoTests.cs | 39 +++++++++++++ .../Views/IPApiIPGeolocationWidgetView.xaml | 32 +++-------- .../Views/IPGeolocationView.xaml | 32 +++-------- Website/docs/changelog/next-release.md | 2 + 5 files changed, 109 insertions(+), 51 deletions(-) create mode 100644 Source/NETworkManager.Tests/IPApi/IPGeolocationInfoTests.cs diff --git a/Source/NETworkManager.Models/IPApi/IPGeolocationInfo.cs b/Source/NETworkManager.Models/IPApi/IPGeolocationInfo.cs index 7901ea2d24..ae68b66752 100644 --- a/Source/NETworkManager.Models/IPApi/IPGeolocationInfo.cs +++ b/Source/NETworkManager.Models/IPApi/IPGeolocationInfo.cs @@ -1,4 +1,7 @@ -namespace NETworkManager.Models.IPApi; +using System; +using Newtonsoft.Json; + +namespace NETworkManager.Models.IPApi; /// /// Class contains the IP geolocation information. @@ -124,4 +127,54 @@ public class IPGeolocationInfo /// IP address used for the query. /// public string Query { get; set; } + + /// + /// Continent with its code, e.g. Europe (EU). + /// + [JsonIgnore] + public string ContinentWithCode => FormatNameWithCode(Continent, ContinentCode); + + /// + /// Country with its code, e.g. Germany (DE). + /// + [JsonIgnore] + public string CountryWithCode => FormatNameWithCode(Country, CountryCode); + + /// + /// Region with its code, e.g. Hesse (HE). + /// + [JsonIgnore] + public string RegionWithCode => FormatNameWithCode(RegionName, Region); + + /// + /// Offset from UTC, e.g. UTC+01:00. + /// + [JsonIgnore] + public string UtcOffset => FormatUtcOffset(Offset); + + /// + /// Name with its code in brackets, without empty brackets if the code is missing. + /// + /// Name, e.g. Germany. + /// Code, e.g. DE. + /// e.g. Germany (DE), null if both are empty. + public static string FormatNameWithCode(string name, string code) + { + if (string.IsNullOrEmpty(name)) + return string.IsNullOrEmpty(code) ? null : code; + + return string.IsNullOrEmpty(code) ? name : $"{name} ({code})"; + } + + /// + /// Offset from UTC (ip-api.com: seconds, incl. daylight saving time) as text. + /// + /// Offset in seconds, e.g. 3600. + /// e.g. UTC+01:00, UTC+00:00 for 0, UTC-03:30. + public static string FormatUtcOffset(int offsetSeconds) + { + var offset = TimeSpan.FromSeconds(offsetSeconds); + + return $"UTC{(offset < TimeSpan.Zero ? "-" : "+")}{offset:hh\\:mm}"; + } } \ No newline at end of file diff --git a/Source/NETworkManager.Tests/IPApi/IPGeolocationInfoTests.cs b/Source/NETworkManager.Tests/IPApi/IPGeolocationInfoTests.cs new file mode 100644 index 0000000000..0e8bfa603a --- /dev/null +++ b/Source/NETworkManager.Tests/IPApi/IPGeolocationInfoTests.cs @@ -0,0 +1,39 @@ +using NETworkManager.Models.IPApi; +using Xunit; + +namespace NETworkManager.Tests.IPApi; + +public class IPGeolocationInfoTests +{ + [Theory] + [InlineData(0, "UTC+00:00")] // e.g. London in winter (was shown as "-/-") + [InlineData(3600, "UTC+01:00")] + [InlineData(19800, "UTC+05:30")] + [InlineData(-12600, "UTC-03:30")] + [InlineData(-36000, "UTC-10:00")] + [InlineData(50400, "UTC+14:00")] + public void UtcOffsetIsFormatted(int offsetSeconds, string expected) + { + Assert.Equal(expected, IPGeolocationInfo.FormatUtcOffset(offsetSeconds)); + } + + [Theory] + [InlineData("Hesse", "HE", "Hesse (HE)")] + [InlineData("Hesse", "", "Hesse")] + [InlineData("Hesse", null, "Hesse")] + [InlineData("", "HE", "HE")] + [InlineData(null, null, null)] + [InlineData("", "", null)] + public void NameWithCodeHasNoEmptyBrackets(string name, string code, string expected) + { + Assert.Equal(expected, IPGeolocationInfo.FormatNameWithCode(name, code)); + } + + [Fact] + public void RegionWithCodeUsesTheRegionName() + { + var info = new IPGeolocationInfo { RegionName = "Hesse", Region = "HE" }; + + Assert.Equal("Hesse (HE)", info.RegionWithCode); + } +} diff --git a/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml b/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml index cb5a6a658a..3df8365ed0 100644 --- a/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml +++ b/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml @@ -126,32 +126,14 @@ - - - - - - - - + - - - - - - - - + - - - - - - - - + @@ -172,7 +154,7 @@ Text="{Binding Result.Info.Timezone, Converter={StaticResource StringNullOrEmptyToStringConverter}}" /> + Text="{Binding Result.Info.UtcOffset, Mode=OneWay, Converter={StaticResource StringNullOrEmptyToStringConverter}}" /> diff --git a/Source/NETworkManager/Views/IPGeolocationView.xaml b/Source/NETworkManager/Views/IPGeolocationView.xaml index ec879c117d..0d86699a9f 100644 --- a/Source/NETworkManager/Views/IPGeolocationView.xaml +++ b/Source/NETworkManager/Views/IPGeolocationView.xaml @@ -175,32 +175,14 @@ Margin="0,0,0,10" Foreground="{DynamicResource MahApps.Brushes.Gray3}" /> - - - - - - - - + - - - - - - - - + - - - - - - - - + @@ -222,7 +204,7 @@ Text="{Binding Result.Timezone, Converter={StaticResource StringNullOrEmptyToStringConverter}}" /> + Text="{Binding Result.UtcOffset, Mode=OneWay, Converter={StaticResource StringNullOrEmptyToStringConverter}}" /> Date: Fri, 27 Nov 2026 00:33:58 +0100 Subject: [PATCH 15/43] Fix: Dashboard: IP geolocation rate limit with the time left (C2) Co-Authored-By: Claude Opus 5.5 --- .../Resources/Strings.Designer.cs | 10 ---------- .../NETworkManager.Localization/Resources/Strings.resx | 4 ---- .../ViewModels/IPApiIPGeolocationWidgetViewModel.cs | 5 ++++- Website/docs/changelog/next-release.md | 1 + 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/Source/NETworkManager.Localization/Resources/Strings.Designer.cs b/Source/NETworkManager.Localization/Resources/Strings.Designer.cs index 34d986226b..b00fdf037e 100644 --- a/Source/NETworkManager.Localization/Resources/Strings.Designer.cs +++ b/Source/NETworkManager.Localization/Resources/Strings.Designer.cs @@ -7321,16 +7321,6 @@ public static string IPAddressToDetectLocalIPAddressBasedOnRouting { } } - /// - /// Looks up a localized string similar to ip-api.com rate limit reached (too many requests from your network)! - ///Try again in a few seconds.. - /// - public static string IPApiRateLimitMessage { - get { - return ResourceManager.GetString("IPApiRateLimitMessage", resourceCulture); - } - } - /// /// Looks up a localized string similar to IP endpoint. /// diff --git a/Source/NETworkManager.Localization/Resources/Strings.resx b/Source/NETworkManager.Localization/Resources/Strings.resx index 4f716f4d67..7a1aa1b9f2 100644 --- a/Source/NETworkManager.Localization/Resources/Strings.resx +++ b/Source/NETworkManager.Localization/Resources/Strings.resx @@ -3750,10 +3750,6 @@ URL: http://ip-api.com/ Check your network connection and try again in a few seconds. - - ip-api.com rate limit reached (too many requests from your network)! -Try again in a few seconds. - HTTP status code diff --git a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs index 2a7b7461dc..b11345d4d1 100644 --- a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs @@ -171,7 +171,10 @@ private async Task CheckAsync() { Log.Warn($"ip-api.com rate limit reached. Try again in {result.RateLimitRemainingTime} seconds."); - ShowStatusMessage(Strings.IPApiRateLimitMessage, StatusLevel.Warning); + // Like the IP Geolocation tool and the traceroute + ShowStatusMessage( + $"{IPGeolocationService.Host} {string.Format(Strings.RateLimitReachedTryAgainInXSeconds, result.RateLimitRemainingTime)}", + StatusLevel.Warning); } else { diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index 4d1c20a8d2..17c72692fc 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -73,6 +73,7 @@ Release date: **xx.xx.2026** - The speed test shows below its header when it was canceled or failed (translated, e.g. no response within 15 seconds or the HTTP status code) instead of replacing the measured values with the English error text of .NET: the values measured until then stay visible. The phase of the running test is no longer shown in the accent color. [#3740](https://github.com/BornToBeRoot/NETworkManager/pull/3740) - The speed test shows the time of the test ("Last test at ...") next to its buttons, like the network connection, so an old result is recognized (the tooltip shows the date). A canceled or failed test shows no time. [#3740](https://github.com/BornToBeRoot/NETworkManager/pull/3740) - New **Copy all** button in the speed test: copies download, upload, latency, jitter, ISP, server and the time of the test as text, like the network connection. [#3740](https://github.com/BornToBeRoot/NETworkManager/pull/3740) +- The IP geolocation widget shows when ip-api.com can be requested again after its rate limit was reached ("Rate limit reached! Try again in ... seconds", like the IP Geolocation tool), as a warning below its header. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Status window** From de48d891d43750cb371cb9e8f425501c36b70367 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:34:32 +0100 Subject: [PATCH 16/43] Fix: IP API: PTR record in the mono font (C5) Co-Authored-By: Claude Opus 5.5 --- Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml | 2 +- Source/NETworkManager/Views/IPGeolocationView.xaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml b/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml index 3df8365ed0..f063bfadfb 100644 --- a/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml +++ b/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml @@ -184,7 +184,7 @@ Text="{Binding Result.Info.Query, Converter={StaticResource StringNullOrEmptyToStringConverter}}" /> + Text="{Binding Result.Info.Reverse, Converter={StaticResource StringNullOrEmptyToStringConverter}}" FontFamily="{StaticResource Fonts.Family.Mono}" /> diff --git a/Source/NETworkManager/Views/IPGeolocationView.xaml b/Source/NETworkManager/Views/IPGeolocationView.xaml index 0d86699a9f..8412293a03 100644 --- a/Source/NETworkManager/Views/IPGeolocationView.xaml +++ b/Source/NETworkManager/Views/IPGeolocationView.xaml @@ -237,7 +237,7 @@ + Text="{Binding Result.Reverse, Converter={StaticResource StringNullOrEmptyToStringConverter}}" FontFamily="{StaticResource Fonts.Family.Mono}" /> From 3a012a7a55ea5262e6b2e0e6894943d89e98cff7 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:36:40 +0100 Subject: [PATCH 17/43] Feature: Dashboard: IP geolocation / DNS resolver enable button when the check is disabled (M2, C4) Co-Authored-By: Claude Opus 5.5 --- .../Resources/Strings.Designer.cs | 29 +++++++++++----- .../Resources/Strings.resx | 11 +++++-- .../ViewModels/DashboardSettingsViewModel.cs | 17 ++++++++++ .../IPApiDNSResolverWidgetViewModel.cs | 13 ++++++++ .../IPApiIPGeolocationWidgetViewModel.cs | 13 ++++++++ .../Views/IPApiDNSResolverWidgetView.xaml | 33 +++++++++++++++---- .../Views/IPApiIPGeolocationWidgetView.xaml | 31 ++++++++++++++--- Website/docs/changelog/next-release.md | 1 + 8 files changed, 126 insertions(+), 22 deletions(-) diff --git a/Source/NETworkManager.Localization/Resources/Strings.Designer.cs b/Source/NETworkManager.Localization/Resources/Strings.Designer.cs index b00fdf037e..ec7e2ae289 100644 --- a/Source/NETworkManager.Localization/Resources/Strings.Designer.cs +++ b/Source/NETworkManager.Localization/Resources/Strings.Designer.cs @@ -2170,15 +2170,6 @@ public static string CheckIPGeolocation { } } - /// - /// Looks up a localized string similar to Check is disabled!. - /// - public static string CheckIsDisabled { - get { - return ResourceManager.GetString("CheckIsDisabled", resourceCulture); - } - } - /// /// Looks up a localized string similar to Check your network adapter configuration (dns) and if your dns server is configured correctly.. /// @@ -4108,6 +4099,16 @@ public static string DNSResolver { } } + /// + /// Looks up a localized string similar to Show the DNS server that resolves your requests with edns.ip-api.com. + ///ip-api.com receives your IP address and the IP address of your DNS server.. + /// + public static string DNSResolverWidgetDisabledMessage { + get { + return ResourceManager.GetString("DNSResolverWidgetDisabledMessage", resourceCulture); + } + } + /// /// Looks up a localized string similar to DNSSEC. /// @@ -7339,6 +7340,16 @@ public static string IPGeolocation { } } + /// + /// Looks up a localized string similar to Show the location and the internet provider of your public IP address with ip-api.com. + ///ip-api.com receives your IP address (http, not encrypted).. + /// + public static string IPGeolocationWidgetDisabledMessage { + get { + return ResourceManager.GetString("IPGeolocationWidgetDisabledMessage", resourceCulture); + } + } + /// /// Looks up a localized string similar to IP range. /// diff --git a/Source/NETworkManager.Localization/Resources/Strings.resx b/Source/NETworkManager.Localization/Resources/Strings.resx index 7a1aa1b9f2..0f1bb89c76 100644 --- a/Source/NETworkManager.Localization/Resources/Strings.resx +++ b/Source/NETworkManager.Localization/Resources/Strings.resx @@ -3086,9 +3086,6 @@ Enable profile file encryption in Settings>Profile to store credentials secur ICMPv6 - - Check is disabled! - Enter a valid IPv6 address! @@ -5763,4 +5760,12 @@ Do you want to start the scan? Last test at {0} + + Show the location and the internet provider of your public IP address with ip-api.com. +ip-api.com receives your IP address (http, not encrypted). + + + Show the DNS server that resolves your requests with edns.ip-api.com. +ip-api.com receives your IP address and the IP address of your DNS server. + \ No newline at end of file diff --git a/Source/NETworkManager/ViewModels/DashboardSettingsViewModel.cs b/Source/NETworkManager/ViewModels/DashboardSettingsViewModel.cs index d5aa014d4b..d34534ddfa 100644 --- a/Source/NETworkManager/ViewModels/DashboardSettingsViewModel.cs +++ b/Source/NETworkManager/ViewModels/DashboardSettingsViewModel.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using NETworkManager.Settings; namespace NETworkManager.ViewModels; @@ -275,6 +276,22 @@ public DashboardSettingsViewModel() LoadSettings(); _isLoading = false; + + // The checks can also be enabled in the widgets (the settings view is created once) + SettingsManager.Current.PropertyChanged += SettingsManager_PropertyChanged; + } + + private void SettingsManager_PropertyChanged(object sender, PropertyChangedEventArgs e) + { + switch (e.PropertyName) + { + case nameof(SettingsInfo.Dashboard_CheckIPApiIPGeolocation): + CheckIPApiIPGeolocationEnabled = SettingsManager.Current.Dashboard_CheckIPApiIPGeolocation; + break; + case nameof(SettingsInfo.Dashboard_CheckIPApiDNSResolver): + CheckIPApiDNSResolverEnabled = SettingsManager.Current.Dashboard_CheckIPApiDNSResolver; + break; + } } /// diff --git a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs index c64c75cd23..63cedc3418 100644 --- a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs @@ -121,6 +121,19 @@ private void LoadSettings() /// public ICommand CheckCommand => new RelayCommand(_ => Check(), _ => !IsRunning); + /// + /// Gets the command to enable the DNS resolver check (setting Dashboard_CheckIPApiDNSResolver, off by default: ip-api.com receives + /// the IP address) and to check right away. + /// + public ICommand EnableCheckCommand => new RelayCommand(_ => EnableCheckAction()); + + private void EnableCheckAction() + { + SettingsManager.Current.Dashboard_CheckIPApiDNSResolver = true; + + Check(); + } + #endregion #region Methods diff --git a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs index b11345d4d1..32418f8747 100644 --- a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs @@ -121,6 +121,19 @@ private void LoadSettings() /// public ICommand CheckCommand => new RelayCommand(_ => Check(), _ => !IsRunning); + /// + /// Gets the command to enable the IP geolocation check (setting Dashboard_CheckIPApiIPGeolocation, off by default: ip-api.com receives + /// the IP address) and to check right away. + /// + public ICommand EnableCheckCommand => new RelayCommand(_ => EnableCheckAction()); + + private void EnableCheckAction() + { + SettingsManager.Current.Dashboard_CheckIPApiIPGeolocation = true; + + Check(); + } + #endregion #region Methods diff --git a/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml b/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml index 0458d93a48..548c26e100 100644 --- a/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml +++ b/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml @@ -78,7 +78,7 @@ - @@ -133,11 +133,32 @@ Style="{StaticResource MessageTextBlock}" /> - + + + + + + + + + + - + + + + + + Dashboard**) and checks right away. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- The IP geolocation and DNS resolver widgets show the time of the last check next to their refresh button, like the network connection, and have a new **Copy all** button that copies all values as text. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Status window** From f442373d207fbb64a8df656d27d052f653c41ded Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:39:00 +0100 Subject: [PATCH 19/43] Refactor: Navigation: Open an application with a target (shared request mapping) Co-Authored-By: Claude Opus 5.5 --- Source/NETworkManager/NavigationManager.cs | 16 ++++++++++++++++ .../ViewModels/ConnectionCheckItem.cs | 14 ++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Source/NETworkManager/NavigationManager.cs b/Source/NETworkManager/NavigationManager.cs index 72a25b6734..f7bbf261c6 100644 --- a/Source/NETworkManager/NavigationManager.cs +++ b/Source/NETworkManager/NavigationManager.cs @@ -35,6 +35,22 @@ public static void Open(ApplicationRequest request) ApplicationRequested?.Invoke(null, request); } + /// + /// Opens an application with a target (IP address or host name), e.g. from the context menu of a value ("open in + /// other tool"). DNS Lookup and RDAP get their own request (record type / query type from the target). + /// + /// Application to open. + /// IP address or host name. + public static void Open(ApplicationName application, string target) + { + Open(application switch + { + ApplicationName.DNSLookup => new DNSLookupRequest { Target = target }, + ApplicationName.RDAP => new RDAPRequest { Target = target }, + _ => new ApplicationRequest(application) { Target = target } + }); + } + /// /// Opens the settings of the current application. /// diff --git a/Source/NETworkManager/ViewModels/ConnectionCheckItem.cs b/Source/NETworkManager/ViewModels/ConnectionCheckItem.cs index 051705a8db..c238541a4d 100644 --- a/Source/NETworkManager/ViewModels/ConnectionCheckItem.cs +++ b/Source/NETworkManager/ViewModels/ConnectionCheckItem.cs @@ -220,13 +220,11 @@ private void OpenApplicationAction(object parameter) if (parameter is not ApplicationName applicationName || Target == null) return; - NavigationManager.Open(applicationName switch - { - ApplicationName.DNSLookup => new DNSLookupRequest { Target = Target }, - ApplicationName.RDAP => new RDAPRequest { Target = Target }, - ApplicationName.WebConsole => new ApplicationRequest(applicationName) - { Target = WebConsoleUrlHelper.CreateUrl(Target, Enumerable.Empty()) }, - _ => new ApplicationRequest(applicationName) { Target = Target } - }); + // The router's web interface as URL + if (applicationName == ApplicationName.WebConsole) + NavigationManager.Open(new ApplicationRequest(applicationName) + { Target = WebConsoleUrlHelper.CreateUrl(Target, Enumerable.Empty()) }); + else + NavigationManager.Open(applicationName, Target); } } From f6553713340747336bef43ac88c60f66f7837e03 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:40:11 +0100 Subject: [PATCH 20/43] Feature: Dashboard: IP geolocation / DNS resolver values open in other tools (M3) Co-Authored-By: Claude Opus 5.5 --- .../Resources/ContextMenu/ContextMenu.xaml | 108 +++++++++++++++++- .../IPApiDNSResolverWidgetViewModel.cs | 22 ++++ .../IPApiIPGeolocationWidgetViewModel.cs | 22 ++++ .../Views/IPApiDNSResolverWidgetView.xaml | 6 +- .../Views/IPApiIPGeolocationWidgetView.xaml | 6 +- Website/docs/changelog/next-release.md | 1 + 6 files changed, 160 insertions(+), 5 deletions(-) diff --git a/Source/NETworkManager/Resources/ContextMenu/ContextMenu.xaml b/Source/NETworkManager/Resources/ContextMenu/ContextMenu.xaml index 8e465f6520..23bd0c6bf9 100644 --- a/Source/NETworkManager/Resources/ContextMenu/ContextMenu.xaml +++ b/Source/NETworkManager/Resources/ContextMenu/ContextMenu.xaml @@ -1,7 +1,8 @@  + xmlns:localization="clr-namespace:NETworkManager.Localization.Resources;assembly=NETworkManager.Localization" + xmlns:models="clr-namespace:NETworkManager.Models;assembly=NETworkManager.Models"> @@ -94,4 +95,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs index be753cb807..64a20c2404 100644 --- a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs @@ -5,6 +5,7 @@ using log4net; using NETworkManager.Controls; using NETworkManager.Localization.Resources; +using NETworkManager.Models; using NETworkManager.Models.IPApi; using NETworkManager.Settings; using NETworkManager.Utilities; @@ -145,6 +146,27 @@ private void LoadSettings() /// public ICommand CopyAllCommand => new RelayCommand(_ => CopyAllAction(), _ => !IsRunning && Result?.Info != null); + /// + /// Gets the command to open the IP address of the DNS server in another tool (parameter: ). + /// + public ICommand OpenDNSServerCommand => new RelayCommand(parameter => OpenApplication(parameter, Result?.Info?.DnsIp), + _ => !string.IsNullOrEmpty(Result?.Info?.DnsIp)); + + /// + /// Gets the command to open the EDNS client subnet in another tool (parameter: ). + /// + public ICommand OpenEDNSCommand => new RelayCommand(parameter => OpenApplication(parameter, Result?.Info?.EdnsIp), + _ => !string.IsNullOrEmpty(Result?.Info?.EdnsIp)); + + /// + /// Opens a value in another tool (context menu, parameter: ). + /// + private static void OpenApplication(object parameter, string target) + { + if (parameter is ApplicationName application && !string.IsNullOrEmpty(target)) + NavigationManager.Open(application, target); + } + /// /// Gets the command to enable the DNS resolver check (setting Dashboard_CheckIPApiDNSResolver, off by default: ip-api.com receives /// the IP address) and to check right away. diff --git a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs index d1e8d45ef8..d77e2ccb30 100644 --- a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs @@ -6,6 +6,7 @@ using log4net; using NETworkManager.Controls; using NETworkManager.Localization.Resources; +using NETworkManager.Models; using NETworkManager.Models.IPApi; using NETworkManager.Settings; using NETworkManager.Utilities; @@ -145,6 +146,27 @@ private void LoadSettings() /// public ICommand CopyAllCommand => new RelayCommand(_ => CopyAllAction(), _ => !IsRunning && Result?.Info != null); + /// + /// Gets the command to open the public IP address in another tool (parameter: ). + /// + public ICommand OpenIPAddressCommand => new RelayCommand(parameter => OpenApplication(parameter, Result?.Info?.Query), + _ => !string.IsNullOrEmpty(Result?.Info?.Query)); + + /// + /// Gets the command to open the PTR record in another tool (parameter: ). + /// + public ICommand OpenPTRRecordCommand => new RelayCommand(parameter => OpenApplication(parameter, Result?.Info?.Reverse), + _ => !string.IsNullOrEmpty(Result?.Info?.Reverse)); + + /// + /// Opens a value in another tool (context menu, parameter: ). + /// + private static void OpenApplication(object parameter, string target) + { + if (parameter is ApplicationName application && !string.IsNullOrEmpty(target)) + NavigationManager.Open(application, target); + } + /// /// Gets the command to enable the IP geolocation check (setting Dashboard_CheckIPApiIPGeolocation, off by default: ip-api.com receives /// the IP address) and to check right away. diff --git a/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml b/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml index 3a2bf2c975..2a2e769232 100644 --- a/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml +++ b/Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml @@ -142,7 +142,8 @@ Margin="0,0,0,10" Foreground="{DynamicResource MahApps.Brushes.Gray3}" /> + Text="{Binding Result.Info.DnsIp, Converter={StaticResource StringNullOrEmptyToStringConverter}}" FontFamily="{StaticResource Fonts.Family.Mono}" + ContextMenu="{StaticResource OpenIPAddressContextMenu}" Tag="{Binding OpenDNSServerCommand}" /> @@ -150,7 +151,8 @@ Margin="0,20,0,10" Foreground="{DynamicResource MahApps.Brushes.Gray3}" /> + Text="{Binding Result.Info.EdnsIp, Converter={StaticResource StringNullOrEmptyToStringConverter}}" FontFamily="{StaticResource Fonts.Family.Mono}" + ContextMenu="{StaticResource OpenIPAddressContextMenu}" Tag="{Binding OpenEDNSCommand}" /> diff --git a/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml b/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml index db9b2b6f77..80033a21a9 100644 --- a/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml +++ b/Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml @@ -211,10 +211,12 @@ Margin="0,0,0,10" Foreground="{DynamicResource MahApps.Brushes.Gray3}" /> + Text="{Binding Result.Info.Query, Converter={StaticResource StringNullOrEmptyToStringConverter}}" + ContextMenu="{StaticResource OpenIPAddressContextMenu}" Tag="{Binding OpenIPAddressCommand}" /> + Text="{Binding Result.Info.Reverse, Converter={StaticResource StringNullOrEmptyToStringConverter}}" FontFamily="{StaticResource Fonts.Family.Mono}" + ContextMenu="{StaticResource OpenDNSNameContextMenu}" Tag="{Binding OpenPTRRecordCommand}" /> diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index 74d2fcf952..28e4097e3b 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -76,6 +76,7 @@ Release date: **xx.xx.2026** - The IP geolocation widget shows when ip-api.com can be requested again after its rate limit was reached ("Rate limit reached! Try again in ... seconds", like the IP Geolocation tool), as a warning below its header. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - The IP geolocation and DNS resolver widgets show what they request from ip-api.com and an **Enable** button when their check is disabled (default), instead of "Check is disabled!". The button enables the check (like **Settings > Dashboard**) and checks right away. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - The IP geolocation and DNS resolver widgets show the time of the last check next to their refresh button, like the network connection, and have a new **Copy all** button that copies all values as text. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- The IP addresses of the IP geolocation and DNS resolver widgets (public IP address, DNS server, EDNS client subnet) can be opened in other tools via the context menu, like the network connection: Port Scanner, Ping Monitor, Traceroute, DNS Lookup, RDAP and IP Geolocation. The PTR record opens in the DNS Lookup. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Status window** From 099aad680fb32402337fbb97c8e7b3560b298a57 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:41:17 +0100 Subject: [PATCH 21/43] Fix: IP Geolocation: Query without a geolocation shows the reason (X2) Co-Authored-By: Claude Opus 5.5 --- .../Resources/Strings.Designer.cs | 9 +++++++++ .../Resources/Strings.resx | 3 +++ .../IPApi/IPGeolocationInfo.cs | 13 +++++++++++++ .../IPApi/IPGeolocationServiceTests.cs | 18 ++++++++++++++++++ .../ViewModels/IPGeolocationViewModel.cs | 13 +++++++++++++ Website/docs/changelog/next-release.md | 1 + 6 files changed, 57 insertions(+) diff --git a/Source/NETworkManager.Localization/Resources/Strings.Designer.cs b/Source/NETworkManager.Localization/Resources/Strings.Designer.cs index ec7e2ae289..0684546ab3 100644 --- a/Source/NETworkManager.Localization/Resources/Strings.Designer.cs +++ b/Source/NETworkManager.Localization/Resources/Strings.Designer.cs @@ -16750,6 +16750,15 @@ public static string XXXDisconnected { } } + /// + /// Looks up a localized string similar to {0} has no IP geolocation for "{1}" ({2}).. + /// + public static string XXXHasNoIPGeolocationForXXXReasonXXX { + get { + return ResourceManager.GetString("XXXHasNoIPGeolocationForXXXReasonXXX", resourceCulture); + } + } + /// /// Looks up a localized string similar to "{0}" is not reachable via ICMP!. /// diff --git a/Source/NETworkManager.Localization/Resources/Strings.resx b/Source/NETworkManager.Localization/Resources/Strings.resx index 0f1bb89c76..d735533dd3 100644 --- a/Source/NETworkManager.Localization/Resources/Strings.resx +++ b/Source/NETworkManager.Localization/Resources/Strings.resx @@ -5768,4 +5768,7 @@ ip-api.com receives your IP address (http, not encrypted). Show the DNS server that resolves your requests with edns.ip-api.com. ip-api.com receives your IP address and the IP address of your DNS server. + + {0} has no IP geolocation for "{1}" ({2}). + \ No newline at end of file diff --git a/Source/NETworkManager.Models/IPApi/IPGeolocationInfo.cs b/Source/NETworkManager.Models/IPApi/IPGeolocationInfo.cs index ae68b66752..e7c357c706 100644 --- a/Source/NETworkManager.Models/IPApi/IPGeolocationInfo.cs +++ b/Source/NETworkManager.Models/IPApi/IPGeolocationInfo.cs @@ -13,6 +13,19 @@ public class IPGeolocationInfo /// public string Status { get; set; } + /// + /// Reason if the query failed ( fail), e.g. private range, + /// reserved range or invalid query. + /// + public string Message { get; set; } + + /// + /// ip-api.com has no geolocation for the query (HTTP 200 with fail, e.g. a private + /// IP address), see . + /// + [JsonIgnore] + public bool HasFailed => string.Equals(Status, "fail", StringComparison.OrdinalIgnoreCase); + /// /// Continent where the IP address is located. /// diff --git a/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs b/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs index 1f2aaeacda..92e3dd9d9f 100644 --- a/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs +++ b/Source/NETworkManager.Tests/IPApi/IPGeolocationServiceTests.cs @@ -57,6 +57,24 @@ public void ResponseIsParsed() Assert.Equal("203.0.113.10", result.Info.Query); } + [Fact] + public void FailedQueryHasTheReason() + { + // HTTP 200, no error of the request: the IP Geolocation tool shows the reason, the traceroute an empty hop + var result = IPGeolocationService.ParseResponse( + "{\"status\":\"fail\",\"message\":\"private range\",\"query\":\"192.168.1.1\"}"); + + Assert.False(result.HasError); + Assert.True(result.Info.HasFailed); + Assert.Equal("private range", result.Info.Message); + } + + [Fact] + public void SuccessfulQueryHasNotFailed() + { + Assert.False(IPGeolocationService.ParseResponse("{\"status\":\"success\"}").Info.HasFailed); + } + [Theory] [InlineData("")] [InlineData("null")] diff --git a/Source/NETworkManager/ViewModels/IPGeolocationViewModel.cs b/Source/NETworkManager/ViewModels/IPGeolocationViewModel.cs index ce037e2b05..ed9455ec20 100644 --- a/Source/NETworkManager/ViewModels/IPGeolocationViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPGeolocationViewModel.cs @@ -277,6 +277,19 @@ private async Task Query() return; } + // No geolocation for the query (HTTP 200, e.g. a private IP address): the reason instead of an empty result + if (result.Info.HasFailed) + { + Log.Warn($"ip-api.com has no geolocation for {Host}: {result.Info.Message}"); + + StatusMessage = string.Format(Strings.XXXHasNoIPGeolocationForXXXReasonXXX, IPGeolocationService.Host, + Host, result.Info.Message); + StatusMessageLevel = StatusLevel.Warning; + IsStatusMessageDisplayed = true; + + return; + } + Result = result.Info; IsResultVisible = true; diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index 28e4097e3b..c6dd40d869 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -197,6 +197,7 @@ Release date: **xx.xx.2026** - Fixed every query failing with "The rate limit values couldn't be extracted from the http header..." when a proxy removed the rate limit headers of ip-api.com. The result is shown, the rate limit is still detected by ip-api.com's answer (HTTP 429). [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed an empty response of ip-api.com (e.g. from a proxy) being shown as an empty result instead of an error. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the offset being shown as `-/-` for locations in UTC+0 (e.g. London in winter) and in seconds (e.g. `3600`). It is shown as `UTC+01:00`. A region without a code is shown without empty brackets. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed an IP address or host name without a geolocation (e.g. a private IP address like `192.168.1.1` or an invalid query) being shown as an empty result. A warning shows the reason of ip-api.com (e.g. `private range`). [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Traceroute** From da129a8bffeeb31eb4782cce8a79e0a9b989bc8e Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:43:03 +0100 Subject: [PATCH 22/43] Docs: Dashboard: IP geolocation and DNS resolver widgets, IP Geolocation limits (D1) Co-Authored-By: Claude Opus 5.5 --- Website/docs/application/dashboard.md | 30 +++++++++++++++++++--- Website/docs/application/ip-geolocation.md | 2 ++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/Website/docs/application/dashboard.md b/Website/docs/application/dashboard.md index d69814f351..f9a4616ed9 100644 --- a/Website/docs/application/dashboard.md +++ b/Website/docs/application/dashboard.md @@ -6,7 +6,7 @@ keywords: [NETworkManager, dashboard, network status, network connection, networ # Dashboard -The **Dashboard** shows the status of your computer's current network connection to provide a quick overview of the most important information. Whenever the local network adapter changes state (e.g. an Ethernet cable is plugged in, Wi-Fi or VPN connects), the dashboard checks connectivity to the router and the internet. When you switch back to the dashboard (or show the window again from the tray / taskbar), the network connection is only checked again if the last check is at least 60 seconds old (e.g. the public IP address may have changed) or the network or a setting of the network connection (e.g. the public IP address) has changed in the meantime, so switching between the tools doesn't send a request each time. **F5** or the refresh button always checks again. +The **Dashboard** shows the status of your computer's current network connection to provide a quick overview of the most important information. Whenever the local network adapter changes state (e.g. an Ethernet cable is plugged in, Wi-Fi or VPN connects), the dashboard checks connectivity to the router and the internet. The [IP geolocation](#ip-geolocation) and the [DNS resolver](#dns-resolver) are checked again together with the network connection (the public IP address may have changed, e.g. a VPN connected). When you switch back to the dashboard (or show the window again from the tray / taskbar), the widgets are only checked again if the last check is at least 60 seconds old (e.g. the public IP address may have changed) or the network or a setting of a check (e.g. the public IP address) has changed in the meantime, so switching between the tools doesn't send a request each time. **F5** or the refresh button of a widget always checks it again. ![Dashboard](../img/dashboard.png) @@ -31,7 +31,7 @@ Right-click a value to open it in another tool: an IP address in the **Port Scan :::note -`F5` only works while the **Network connection** widget has the focus (e.g. click into it first). The other widgets are refreshed with their refresh button. +`F5` only works while the widget has the focus (e.g. click into it first). It checks the **Network connection**, **IP geolocation** or **DNS resolver** widget again; the speed test is only started with its button. ::: @@ -157,9 +157,33 @@ The test measures like the official [cloudflare/speedtest](https://github.com/cl A test takes about 15 seconds on a fast connection and up to 1–2 minutes on a slow one. It transfers a lot of data on a fast connection: up to about 1 GB download and 300 MB upload (1 Gbit/s), keep this in mind on a metered connection (e.g. mobile data). +## IP geolocation + +The **IP geolocation** widget shows the location and the network of your public IPv4 address from [`ip-api.com`](https://ip-api.com/) (the same values as the [IP Geolocation](ip-geolocation.md) tool): + +- **Location**: continent, country, region, city, district, zip code, latitude / longitude, time zone, offset from UTC (e.g. `UTC+01:00`, incl. daylight saving time) and currency +- **Network**: IP address, PTR record, ISP, organization, ASN / AS name, and whether the IP address belongs to a hosting provider, a proxy / VPN or a mobile network + +## DNS resolver + +The **DNS resolver** widget shows the DNS server that resolves the requests of your computer on the internet, detected with [`edns.ip-api.com`](https://ip-api.com/docs/dns): its IP address and geolocation (**DNS**), and the client subnet that the DNS server forwards (**EDNS**, e.g. `203.0.113.0`, `-/-` if it doesn't send one). If you use the DNS server of your router or internet provider, this is the server the requests are forwarded to (e.g. `1.1.1.1` or a server of the provider), not the router. + +## IP geolocation and DNS resolver + +Both checks send your IP address to `ip-api.com` and are disabled by default (welcome dialog). A widget whose check is disabled shows what it requests and an **Enable** button, which enables the check (like [Check IP geolocation](#check-ip-geolocation) / [Check DNS resolver](#check-dns-resolver)) and checks right away. + +The buttons in the header of the widgets: + +- **Copy all** copies all values as text, e.g. for a support request. +- **Refresh** checks again (also **F5** while the widget has the focus). + +The header shows the time of the last check (not after an error). An error (e.g. no response within 10 seconds or the HTTP status code) or the rate limit of `ip-api.com` (45 requests per minute from your network, with the time until it can be requested again) is shown below the header. + +Right-click an IP address (public IP address, DNS server, EDNS client subnet) to open it in the **Port Scanner**, **Ping Monitor**, **Traceroute**, **DNS Lookup**, **RDAP** or **IP Geolocation**, and the PTR record in the **DNS Lookup**. **Copy** copies the selected text. + ## Troubleshooting and limits - The local IP address is detected by the route to the [Public IPv4 address](#public-ipv4-address) / [Public IPv6 address](#public-ipv6-address) (no packet is sent), otherwise from the first active network interface. With several network adapters (e.g. LAN and VPN), set an address that is routed via the adapter you want to see. -- The internet is shown as reachable if the [Public IPv4 address](#public-ipv4-address) / [Public IPv6 address](#public-ipv6-address) replies to the ping or the public IP address could be requested from `api.ipify.org` / `api6.ipify.org` (or the [custom API](#use-custom-ipv4-address-api)). If both are blocked (e.g. by a firewall, or websites are only reachable via a proxy), the internet is shown as a warning if Windows reports internet access (IPv4), otherwise as not reachable; use another public IP address / API. The IP geolocation and the DNS resolver are requested from `ip-api.com` (45 requests per minute). +- The internet is shown as reachable if the [Public IPv4 address](#public-ipv4-address) / [Public IPv6 address](#public-ipv6-address) replies to the ping or the public IP address could be requested from `api.ipify.org` / `api6.ipify.org` (or the [custom API](#use-custom-ipv4-address-api)). If both are blocked (e.g. by a firewall, or websites are only reachable via a proxy), the internet is shown as a warning if Windows reports internet access (IPv4), otherwise as not reachable; use another public IP address / API. The IP geolocation and the DNS resolver are requested from `ip-api.com` (45 requests per minute, a request fails after 10 seconds without a response). - Without IPv6 connectivity (or no IPv6 from the internet provider), the IPv6 checks are shown as information (gray) and skipped, the IPv4 checks are not affected. - The [Speed Test](#speed-test) measures the connection to the nearest Cloudflare server. A VPN, a proxy or other traffic on the network at the same time lowers the result. A request of the speed test fails after 15 seconds without a response or data (e.g. the connection was lost). Like the official library, a failed request is skipped (shown as a warning after the test) and a request that is rate limited by Cloudflare (HTTP 429) is repeated up to three times; if all requests of a size fail (e.g. a proxy rejects large uploads), the larger sizes of the direction are skipped. After three requests in a row without a response the test ends with the error. diff --git a/Website/docs/application/ip-geolocation.md b/Website/docs/application/ip-geolocation.md index c123c3e110..7db6e382bb 100644 --- a/Website/docs/application/ip-geolocation.md +++ b/Website/docs/application/ip-geolocation.md @@ -14,6 +14,8 @@ IP geolocation data is provided by [ip-api.com](https://ip-api.com/) and the API ::: +A private or reserved IP address (e.g. `192.168.1.1`) has no geolocation: a warning shows the reason of ip-api.com (e.g. `private range`). The free API endpoint allows 45 requests per minute from your network; when the limit is reached, a warning shows when the next query is possible. A query fails after 10 seconds without a response. + ![IPGeolocation](../img/ip-geolocation.png) ### Example inputs From e7b77df6f304f9d55ebc08e45a430fcead006ba6 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:52:47 +0100 Subject: [PATCH 23/43] Fix: Dashboard: IP geolocation / DNS resolver checked again after a network change during a check (CR1) Co-Authored-By: Claude Opus 5.5 --- .../IPApiDNSResolverWidgetViewModel.cs | 18 +++++++++++++++++- .../IPApiIPGeolocationWidgetViewModel.cs | 18 +++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs index 64a20c2404..0c732c694a 100644 --- a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs @@ -19,6 +19,11 @@ public class IPApiDNSResolverWidgetViewModel : ViewModelBase { #region Variables + /// + /// A check was requested while a check was running (see ). + /// + private bool _recheckPending; + private static readonly ILog Log = LogManager.GetLogger(typeof(IPApiDNSResolverWidgetViewModel)); /// @@ -214,9 +219,13 @@ private void EnableCheckAction() /// public void Check() { - // Already checking, e.g. the network changed right after the widget was created + // Already checking, e.g. the network changed right after the widget was created: the running request may use + // the old network, check again once it has finished if (IsRunning) + { + _recheckPending = true; return; + } _ = CheckAsync(); } @@ -267,6 +276,13 @@ private async Task CheckAsync() // Enable the refresh button (CanExecute is otherwise only evaluated on the next input) CommandManager.InvalidateRequerySuggested(); } + + // A check requested in the meantime (e.g. a network change) + if (_recheckPending) + { + _recheckPending = false; + Check(); + } } #endregion diff --git a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs index d77e2ccb30..fec1382d20 100644 --- a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs @@ -20,6 +20,11 @@ public class IPApiIPGeolocationWidgetViewModel : ViewModelBase { #region Variables + /// + /// A check was requested while a check was running (see ). + /// + private bool _recheckPending; + private static readonly ILog Log = LogManager.GetLogger(typeof(IPApiIPGeolocationWidgetViewModel)); /// @@ -238,9 +243,13 @@ private void EnableCheckAction() /// public void Check() { - // Already checking, e.g. the network changed right after the widget was created + // Already checking, e.g. the network changed right after the widget was created: the running request may use + // the old network, check again once it has finished if (IsRunning) + { + _recheckPending = true; return; + } _ = CheckAsync(); } @@ -298,6 +307,13 @@ private async Task CheckAsync() // Enable the refresh button (CanExecute is otherwise only evaluated on the next input) CommandManager.InvalidateRequerySuggested(); } + + // A check requested in the meantime (e.g. a network change) + if (_recheckPending) + { + _recheckPending = false; + Check(); + } } private void ShowStatusMessage(string message, StatusLevel level) From 400f8563e5f44cf7a12696b02e96276a4b213f2e Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:53:18 +0100 Subject: [PATCH 24/43] Fix: Dashboard: IP geolocation without a geolocation shows the reason (CR3) Co-Authored-By: Claude Opus 5.5 --- .../ViewModels/IPApiIPGeolocationWidgetViewModel.cs | 8 ++++++++ Website/docs/changelog/next-release.md | 1 + 2 files changed, 9 insertions(+) diff --git a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs index fec1382d20..38d9428684 100644 --- a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs @@ -294,6 +294,14 @@ private async Task CheckAsync() $"{IPGeolocationService.Host} {string.Format(Strings.RateLimitReachedTryAgainInXSeconds, result.RateLimitRemainingTime)}", StatusLevel.Warning); } + else if (result.Info.HasFailed) + { + // No geolocation for the public IP address (HTTP 200, e.g. a proxy / NAT64), like the IP Geolocation tool + Log.Warn($"ip-api.com has no geolocation for {result.Info.Query}: {result.Info.Message}"); + + ShowStatusMessage(string.Format(Strings.XXXHasNoIPGeolocationForXXXReasonXXX, IPGeolocationService.Host, + result.Info.Query, result.Info.Message), StatusLevel.Warning); + } else { Result = result; diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index c6dd40d869..b0f2c612ba 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -180,6 +180,7 @@ Release date: **xx.xx.2026** - Fixed the IP geolocation widget failing when a proxy removed the rate limit headers of ip-api.com. The result is shown. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the DNS resolver widget showing "Object reference not set to an instance of an object" when edns.ip-api.com answered with an empty response (e.g. a proxy). An empty response of ip-api.com is shown as an error in both widgets. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the offset of the IP geolocation widget being shown as `-/-` for locations in UTC+0 (e.g. London in winter) and in seconds (e.g. `3600`). It is shown as `UTC+01:00`. A region without a code is shown without empty brackets. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed the IP geolocation widget showing an empty result when ip-api.com had no geolocation for the public IP address (e.g. behind a proxy). A warning shows the reason, like the IP Geolocation tool. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Status window** From bff19446adddb8171200ec8a3338447c89cb8d7d Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:53:49 +0100 Subject: [PATCH 25/43] Fix: Dashboard: IP geolocation / DNS resolver without old message after the check was disabled (CR4) Co-Authored-By: Claude Opus 5.5 --- .../ViewModels/IPApiDNSResolverWidgetViewModel.cs | 9 ++++++++- .../ViewModels/IPApiIPGeolocationWidgetViewModel.cs | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs index 0c732c694a..3201570f47 100644 --- a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs @@ -235,9 +235,16 @@ public void Check() /// private async Task CheckAsync() { - // Check is disabled via settings + // Check is disabled via settings (the dashboard checks again when it is shown after the setting changed): no + // values, message or time of an earlier check next to the "Enable" button if (!SettingsManager.Current.Dashboard_CheckIPApiDNSResolver) + { + IsStatusMessageDisplayed = false; + Result = null; + LastCheckTime = null; + return; + } IsRunning = true; IsStatusMessageDisplayed = false; diff --git a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs index 38d9428684..648c104a65 100644 --- a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs @@ -259,9 +259,16 @@ public void Check() /// private async Task CheckAsync() { - // Check is disabled via settings + // Check is disabled via settings (the dashboard checks again when it is shown after the setting changed): no + // values, message or time of an earlier check next to the "Enable" button if (!SettingsManager.Current.Dashboard_CheckIPApiIPGeolocation) + { + IsStatusMessageDisplayed = false; + Result = null; + LastCheckTime = null; + return; + } IsRunning = true; IsStatusMessageDisplayed = false; From 2ec864aabb15f5d59b35930452e2e65283690676 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:54:35 +0100 Subject: [PATCH 26/43] Fix: Dashboard: No extra check of all widgets after Enable in a widget (CR5) Co-Authored-By: Claude Opus 5.5 --- Source/NETworkManager/Views/DashboardView.xaml.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/NETworkManager/Views/DashboardView.xaml.cs b/Source/NETworkManager/Views/DashboardView.xaml.cs index bfcec1a17d..ecbc59bb4f 100644 --- a/Source/NETworkManager/Views/DashboardView.xaml.cs +++ b/Source/NETworkManager/Views/DashboardView.xaml.cs @@ -207,7 +207,11 @@ private void ApplyWidgetSettings() private void SettingsManager_PropertyChanged(object sender, PropertyChangedEventArgs e) { - if (e.PropertyName != null && CheckSettings.Contains(e.PropertyName)) + // The "Enable" button of an IP API widget (dashboard visible) checks the widget itself, the others are up to date + var isEnabledInWidget = _isViewVisible && e.PropertyName is nameof(SettingsInfo.Dashboard_CheckIPApiIPGeolocation) + or nameof(SettingsInfo.Dashboard_CheckIPApiDNSResolver); + + if (e.PropertyName != null && CheckSettings.Contains(e.PropertyName) && !isEnabledInWidget) _isOutdated = true; // A hidden speed test widget doesn't measure (no data is transferred in the background): cancel it right away, From aab140e9ecc51f52bc4eee0845b5bd675860220e Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:55:31 +0100 Subject: [PATCH 27/43] Fix: IP Geolocation / Traceroute: ip-api.com error translated (CR6) Co-Authored-By: Claude Opus 5.5 --- .../ViewModels/IPGeolocationViewModel.cs | 4 +++- .../ViewModels/TracerouteViewModel.cs | 16 +++++++++++++++- Website/docs/changelog/next-release.md | 2 ++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Source/NETworkManager/ViewModels/IPGeolocationViewModel.cs b/Source/NETworkManager/ViewModels/IPGeolocationViewModel.cs index ed9455ec20..421ccef5ef 100644 --- a/Source/NETworkManager/ViewModels/IPGeolocationViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPGeolocationViewModel.cs @@ -258,7 +258,9 @@ private async Task Query() { Log.Error($"ip-api.com error: {result.ErrorMessage}, error code: {result.ErrorCode}"); - StatusMessage = $"ip-api.com: {result.ErrorMessage}"; + // Translated (the exception text of .NET is logged), like the IP geolocation widget of the dashboard + StatusMessage = WebRequestErrorMessage.Get(IPGeolocationService.Host, + IPGeolocationService.RequestTimeout, result.Error); StatusMessageLevel = StatusLevel.Error; IsStatusMessageDisplayed = true; diff --git a/Source/NETworkManager/ViewModels/TracerouteViewModel.cs b/Source/NETworkManager/ViewModels/TracerouteViewModel.cs index 58a06ddba3..e60b181c86 100644 --- a/Source/NETworkManager/ViewModels/TracerouteViewModel.cs +++ b/Source/NETworkManager/ViewModels/TracerouteViewModel.cs @@ -5,6 +5,7 @@ using NETworkManager.Localization.Resources; using NETworkManager.Models; using NETworkManager.Models.Export; +using NETworkManager.Models.IPApi; using NETworkManager.Models.Network; using NETworkManager.Models.RDAP; using NETworkManager.Settings; @@ -149,6 +150,11 @@ public IList SelectedResults private bool _ipGeolocationRateLimitIsReached; + /// + /// The error of the IP geolocation was shown (once per trace, e.g. not for every hop while ip-api.com is down). + /// + private bool _ipGeolocationErrorIsShown; + /// /// Gets or sets a value indicating whether the status message is displayed. /// @@ -401,6 +407,7 @@ private void StopTrace() private async Task StartTrace() { _ipGeolocationRateLimitIsReached = false; + _ipGeolocationErrorIsShown = false; StatusMessage = string.Empty; StatusMessageLevel = StatusLevel.None; IsStatusMessageDisplayed = false; @@ -542,7 +549,14 @@ private void Traceroute_HopReceived(object sender, TracerouteHopReceivedArgs e) Log.Error( $"ip-api.com error: {e.Args.IPGeolocationResult.ErrorMessage}, error code: {e.Args.IPGeolocationResult.ErrorCode}"); - DisplayStatusMessage($"ip-api.com: {e.Args.IPGeolocationResult.ErrorMessage}"); + // Translated (the exception text of .NET is logged), like the IP geolocation widget of the dashboard + if (!_ipGeolocationErrorIsShown) + { + _ipGeolocationErrorIsShown = true; + + DisplayStatusMessage(WebRequestErrorMessage.Get(IPGeolocationService.Host, + IPGeolocationService.RequestTimeout, e.Args.IPGeolocationResult.Error)); + } } // Check rate limit diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index b0f2c612ba..62c52ca505 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -199,12 +199,14 @@ Release date: **xx.xx.2026** - Fixed an empty response of ip-api.com (e.g. from a proxy) being shown as an empty result instead of an error. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the offset being shown as `-/-` for locations in UTC+0 (e.g. London in winter) and in seconds (e.g. `3600`). It is shown as `UTC+01:00`. A region without a code is shown without empty brackets. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed an IP address or host name without a geolocation (e.g. a private IP address like `192.168.1.1` or an invalid query) being shown as an empty result. A warning shows the reason of ip-api.com (e.g. `private range`). [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed errors of ip-api.com being shown as the English error text of .NET (e.g. "The request was canceled due to the configured HttpClient.Timeout..."). A translated message is shown (e.g. no response within 10 seconds or the HTTP status code), like the dashboard. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Traceroute** - Fixed the traceroute waiting up to 100 seconds per hop when the IP geolocation is enabled and ip-api.com did not respond (e.g. a firewall that drops the request). The geolocation of a hop fails after 10 seconds. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the IP geolocation of every hop failing with "The rate limit values couldn't be extracted from the http header..." when a proxy removed the rate limit headers of ip-api.com. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed an empty response of ip-api.com (e.g. from a proxy) being shown as an empty IP geolocation of the hop instead of an error. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed errors of ip-api.com being shown as the English error text of .NET, once for every hop. A translated message is shown once per trace (e.g. no response within 10 seconds or the HTTP status code). [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) ## Dependencies, Refactoring & Documentation From 7f602c99ac46728ee83fd7b6ad75d513edcf0d04 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:56:09 +0100 Subject: [PATCH 28/43] Fix: Dashboard: EDNS client subnet only opens in RDAP / IP Geolocation (CR7) Co-Authored-By: Claude Opus 5.5 --- .../Resources/ContextMenu/ContextMenu.xaml | 37 +++++++++++++++++++ .../Views/IPApiDNSResolverWidgetView.xaml | 2 +- Website/docs/application/dashboard.md | 2 +- Website/docs/changelog/next-release.md | 2 +- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/Source/NETworkManager/Resources/ContextMenu/ContextMenu.xaml b/Source/NETworkManager/Resources/ContextMenu/ContextMenu.xaml index 23bd0c6bf9..4ece0d3248 100644 --- a/Source/NETworkManager/Resources/ContextMenu/ContextMenu.xaml +++ b/Source/NETworkManager/Resources/ContextMenu/ContextMenu.xaml @@ -176,6 +176,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ContextMenu="{StaticResource OpenSubnetAddressContextMenu}" Tag="{Binding OpenEDNSCommand}" /> diff --git a/Website/docs/application/dashboard.md b/Website/docs/application/dashboard.md index f9a4616ed9..f5f557b77d 100644 --- a/Website/docs/application/dashboard.md +++ b/Website/docs/application/dashboard.md @@ -179,7 +179,7 @@ The buttons in the header of the widgets: The header shows the time of the last check (not after an error). An error (e.g. no response within 10 seconds or the HTTP status code) or the rate limit of `ip-api.com` (45 requests per minute from your network, with the time until it can be requested again) is shown below the header. -Right-click an IP address (public IP address, DNS server, EDNS client subnet) to open it in the **Port Scanner**, **Ping Monitor**, **Traceroute**, **DNS Lookup**, **RDAP** or **IP Geolocation**, and the PTR record in the **DNS Lookup**. **Copy** copies the selected text. +Right-click an IP address (public IP address, DNS server) to open it in the **Port Scanner**, **Ping Monitor**, **Traceroute**, **DNS Lookup**, **RDAP** or **IP Geolocation**, the EDNS client subnet (a network address, not a host) in **RDAP** or **IP Geolocation**, and the PTR record in the **DNS Lookup**. **Copy** copies the selected text. ## Troubleshooting and limits diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index 62c52ca505..88a3af1f7c 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -76,7 +76,7 @@ Release date: **xx.xx.2026** - The IP geolocation widget shows when ip-api.com can be requested again after its rate limit was reached ("Rate limit reached! Try again in ... seconds", like the IP Geolocation tool), as a warning below its header. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - The IP geolocation and DNS resolver widgets show what they request from ip-api.com and an **Enable** button when their check is disabled (default), instead of "Check is disabled!". The button enables the check (like **Settings > Dashboard**) and checks right away. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - The IP geolocation and DNS resolver widgets show the time of the last check next to their refresh button, like the network connection, and have a new **Copy all** button that copies all values as text. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) -- The IP addresses of the IP geolocation and DNS resolver widgets (public IP address, DNS server, EDNS client subnet) can be opened in other tools via the context menu, like the network connection: Port Scanner, Ping Monitor, Traceroute, DNS Lookup, RDAP and IP Geolocation. The PTR record opens in the DNS Lookup. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- The IP addresses of the IP geolocation and DNS resolver widgets (public IP address, DNS server) can be opened in other tools via the context menu, like the network connection: Port Scanner, Ping Monitor, Traceroute, DNS Lookup, RDAP and IP Geolocation. The EDNS client subnet opens in RDAP and IP Geolocation, the PTR record in the DNS Lookup. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Status window** From 223face18032aeb664d0f2efc4fec0c86fe3419d Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:57:27 +0100 Subject: [PATCH 29/43] Fix: Dashboard: Speed test continues when only large requests fail without a response (CR2) Co-Authored-By: Claude Opus 5.5 --- .../Cloudflare/SpeedTestService.cs | 49 +++++++++++++++++-- Website/docs/application/dashboard.md | 2 +- Website/docs/changelog/next-release.md | 1 + 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/Source/NETworkManager.Models/Cloudflare/SpeedTestService.cs b/Source/NETworkManager.Models/Cloudflare/SpeedTestService.cs index 9af49bd6a3..abdc48eb20 100644 --- a/Source/NETworkManager.Models/Cloudflare/SpeedTestService.cs +++ b/Source/NETworkManager.Models/Cloudflare/SpeedTestService.cs @@ -202,8 +202,8 @@ await TryRequestAsync(() => MeasureLatencyAsync(pings, cancellationToken), failu ? MeasureDownloadAsync(measurement.Bytes, cancellationToken, liveBps => Emit(progress, SpeedTestPhase.MeasuringDownload, pings, downloadBps, uploadBps, liveBps)) - : MeasureUploadAsync(measurement.Bytes, cancellationToken), failures, cancellationToken) - .ConfigureAwait(false); + : MeasureUploadAsync(measurement.Bytes, cancellationToken), failures, cancellationToken, + () => IsServerReachableAsync(cancellationToken)).ConfigureAwait(false); if (!success) continue; @@ -366,11 +366,15 @@ private static void EnsureSuccess(HttpResponseMessage response) /// /// Runs a request of the test like the official library: HTTP 429 is repeated after the delay of the server (up to /// times), another error skips the request. After - /// failed requests in a row the error is thrown (the test ends). + /// failed requests in a row without a response the error is thrown (the test ends) - unless the server still + /// answers a small request: then only this size fails (e.g. a proxy that closes the connection of large uploads + /// instead of answering HTTP 413) and the direction ends after the set. /// + /// Checks whether the server answers (download / upload), null for the + /// latency probes (they are small requests themselves). /// false if the request failed and was skipped. private static async Task<(bool Success, T Value)> TryRequestAsync(Func> request, - RequestFailures failures, CancellationToken cancellationToken) + RequestFailures failures, CancellationToken cancellationToken, Func> isServerReachable = null) { for (var retry = 0;; retry++) { @@ -394,9 +398,18 @@ private static void EnsureSuccess(HttpResponseMessage response) failures.Total++; if (!SpeedTestCalculator.IsConnectionFailure(ex)) + { failures.Consecutive = 0; + } else if (++failures.Consecutive >= MaxConsecutiveFailedRequests) - throw; + { + if (isServerReachable == null || !await isServerReachable().ConfigureAwait(false)) + throw; + + // The connection works, only requests of this size fail: skip them (the set fails) + Log.Warn("Speed test requests of this size fail, but the server answers small requests."); + failures.Consecutive = 0; + } Log.Warn("Speed test request failed and is skipped.", ex); @@ -405,6 +418,32 @@ private static void EnsureSuccess(HttpResponseMessage response) } } + /// + /// Checks whether the server answers a small request (an empty download, not measured). + /// + /// false if there is no response (e.g. the connection was lost). + private async Task IsServerReachableAsync(CancellationToken cancellationToken) + { + try + { + return await WithTimeoutAsync(async timeout => + { + using var request = new HttpRequestMessage(HttpMethod.Get, $"{BaseUrl}/__down?bytes=0"); + using var response = await _client + .SendAsync(request, HttpCompletionOption.ResponseHeadersRead, timeout.Token) + .ConfigureAwait(false); + + return true; + }, cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) when (ex is HttpRequestException or IOException or TimeoutException) + { + cancellationToken.ThrowIfCancellationRequested(); + + return false; + } + } + private Task MeasureLatencyAsync(List pings, CancellationToken cancellationToken) { return WithTimeoutAsync(async timeout => diff --git a/Website/docs/application/dashboard.md b/Website/docs/application/dashboard.md index f5f557b77d..a6513bc52d 100644 --- a/Website/docs/application/dashboard.md +++ b/Website/docs/application/dashboard.md @@ -186,4 +186,4 @@ Right-click an IP address (public IP address, DNS server) to open it in the **Po - The local IP address is detected by the route to the [Public IPv4 address](#public-ipv4-address) / [Public IPv6 address](#public-ipv6-address) (no packet is sent), otherwise from the first active network interface. With several network adapters (e.g. LAN and VPN), set an address that is routed via the adapter you want to see. - The internet is shown as reachable if the [Public IPv4 address](#public-ipv4-address) / [Public IPv6 address](#public-ipv6-address) replies to the ping or the public IP address could be requested from `api.ipify.org` / `api6.ipify.org` (or the [custom API](#use-custom-ipv4-address-api)). If both are blocked (e.g. by a firewall, or websites are only reachable via a proxy), the internet is shown as a warning if Windows reports internet access (IPv4), otherwise as not reachable; use another public IP address / API. The IP geolocation and the DNS resolver are requested from `ip-api.com` (45 requests per minute, a request fails after 10 seconds without a response). - Without IPv6 connectivity (or no IPv6 from the internet provider), the IPv6 checks are shown as information (gray) and skipped, the IPv4 checks are not affected. -- The [Speed Test](#speed-test) measures the connection to the nearest Cloudflare server. A VPN, a proxy or other traffic on the network at the same time lowers the result. A request of the speed test fails after 15 seconds without a response or data (e.g. the connection was lost). Like the official library, a failed request is skipped (shown as a warning after the test) and a request that is rate limited by Cloudflare (HTTP 429) is repeated up to three times; if all requests of a size fail (e.g. a proxy rejects large uploads), the larger sizes of the direction are skipped. After three requests in a row without a response the test ends with the error. +- The [Speed Test](#speed-test) measures the connection to the nearest Cloudflare server. A VPN, a proxy or other traffic on the network at the same time lowers the result. A request of the speed test fails after 15 seconds without a response or data (e.g. the connection was lost). Like the official library, a failed request is skipped (shown as a warning after the test) and a request that is rate limited by Cloudflare (HTTP 429) is repeated up to three times; if all requests of a size fail (e.g. a proxy rejects large uploads), the larger sizes of the direction are skipped. After three requests in a row without a response the test ends with the error, unless the server still answers a small request (e.g. a proxy closes the connection of large uploads): then the larger sizes of the direction are skipped. diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index 88a3af1f7c..d2ffd5b44f 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -181,6 +181,7 @@ Release date: **xx.xx.2026** - Fixed the DNS resolver widget showing "Object reference not set to an instance of an object" when edns.ip-api.com answered with an empty response (e.g. a proxy). An empty response of ip-api.com is shown as an error in both widgets. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the offset of the IP geolocation widget being shown as `-/-` for locations in UTC+0 (e.g. London in winter) and in seconds (e.g. `3600`). It is shown as `UTC+01:00`. A region without a code is shown without empty brackets. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the IP geolocation widget showing an empty result when ip-api.com had no geolocation for the public IP address (e.g. behind a proxy). A warning shows the reason, like the IP Geolocation tool. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed the speed test ending with "Could not connect to speed.cloudflare.com" when a proxy closed the connection of large uploads (instead of rejecting them with an HTTP error). After three requests in a row without a response, the test only ends if the server doesn't answer a small request either; otherwise the larger sizes of the direction are skipped. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Status window** From b140d61df24086ad1baab023351444090b4bab05 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 17:49:57 +0100 Subject: [PATCH 30/43] Fix: Dashboard: IP geolocation / DNS resolver checked only once at the start (F1) The widgets no longer start a check in their constructor: the dashboard starts it (CheckWidgets() at the start, a widget shown the first time marks the dashboard as outdated). Before, the dashboard's check right after creating the widget queued a recheck (CR1): two ip-api.com requests per widget at every start. Co-Authored-By: Claude Opus 5.5 --- .../ViewModels/IPApiDNSResolverWidgetViewModel.cs | 4 ++-- .../ViewModels/IPApiIPGeolocationWidgetViewModel.cs | 4 ++-- Source/NETworkManager/Views/DashboardView.xaml.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs index 3201570f47..8d34d8d908 100644 --- a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs @@ -121,12 +121,12 @@ private set #region Constructor, load settings /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. The dashboard starts the check (the + /// widget is created when it is shown the first time). /// public IPApiDNSResolverWidgetViewModel() { LoadSettings(); - Check(); } /// diff --git a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs index 648c104a65..7d0bc19593 100644 --- a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs @@ -122,12 +122,12 @@ private set #region Constructor, load settings /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. The dashboard starts the check (the + /// widget is created when it is shown the first time). /// public IPApiIPGeolocationWidgetViewModel() { LoadSettings(); - Check(); } /// diff --git a/Source/NETworkManager/Views/DashboardView.xaml.cs b/Source/NETworkManager/Views/DashboardView.xaml.cs index ecbc59bb4f..996d3aee03 100644 --- a/Source/NETworkManager/Views/DashboardView.xaml.cs +++ b/Source/NETworkManager/Views/DashboardView.xaml.cs @@ -45,8 +45,8 @@ public DashboardView() // The settings are changed while the dashboard is hidden (settings view) - check again when it is shown SettingsManager.Current.PropertyChanged += SettingsManager_PropertyChanged; - // Check on first open (the IP API widgets are already checking since they were created). Later re-opens are - // covered by OnViewVisible(). + // Check on first open (the widgets don't check when they are created). Later re-opens and widgets shown the + // first time (the setting marks the dashboard as outdated) are covered by OnViewVisible(). CheckWidgets(); } From 2a8fd1990b7bed2b80ccf62ad4e5b690f8bcef33 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 17:50:05 +0100 Subject: [PATCH 31/43] Fix: Dashboard: IP geolocation / DNS resolver hidden during a check sends no recheck (F2) A recheck queued during a check (e.g. a network change) only runs while the widget is shown. A hidden widget is checked when it is shown again (the setting marks the dashboard as outdated). Co-Authored-By: Claude Opus 5.5 --- .../ViewModels/IPApiDNSResolverWidgetViewModel.cs | 7 +++++-- .../ViewModels/IPApiIPGeolocationWidgetViewModel.cs | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs index 8d34d8d908..eb614d6fc4 100644 --- a/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs @@ -284,11 +284,14 @@ private async Task CheckAsync() CommandManager.InvalidateRequerySuggested(); } - // A check requested in the meantime (e.g. a network change) + // A check requested in the meantime (e.g. a network change). A hidden widget doesn't check anything: it is + // checked when it is shown again (the setting marks the dashboard as outdated) if (_recheckPending) { _recheckPending = false; - Check(); + + if (SettingsManager.Current.Dashboard_ShowDNSResolverWidget) + Check(); } } diff --git a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs index 7d0bc19593..09787712f7 100644 --- a/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs +++ b/Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs @@ -323,11 +323,14 @@ private async Task CheckAsync() CommandManager.InvalidateRequerySuggested(); } - // A check requested in the meantime (e.g. a network change) + // A check requested in the meantime (e.g. a network change). A hidden widget doesn't check anything: it is + // checked when it is shown again (the setting marks the dashboard as outdated) if (_recheckPending) { _recheckPending = false; - Check(); + + if (SettingsManager.Current.Dashboard_ShowIPGeolocationWidget) + Check(); } } From f76ca2b4cb386066d774d36efa00fd08b0c5e099 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 17:51:20 +0100 Subject: [PATCH 32/43] Fix: Dashboard: Speed test skips the rest of a size that fails without a response (F3) When three requests in a row got no response but the server still answers a small request, the remaining requests of the set are skipped and the direction ends (before, each of them waited for the 15 s timeout, e.g. ~90 s for six 1 MB uploads through a proxy that silently drops them). Co-Authored-By: Claude Opus 5.5 --- .../Cloudflare/SpeedTestService.cs | 31 +++++++++++++------ Website/docs/application/dashboard.md | 2 +- Website/docs/changelog/next-release.md | 2 +- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Source/NETworkManager.Models/Cloudflare/SpeedTestService.cs b/Source/NETworkManager.Models/Cloudflare/SpeedTestService.cs index abdc48eb20..0c4410d1b8 100644 --- a/Source/NETworkManager.Models/Cloudflare/SpeedTestService.cs +++ b/Source/NETworkManager.Models/Cloudflare/SpeedTestService.cs @@ -195,16 +195,25 @@ await TryRequestAsync(() => MeasureLatencyAsync(pings, cancellationToken), failu } var setSucceeded = false; + var setSizeFailed = false; for (var i = 0; i < measurement.Count; i++) { - var (success, (bps, durationMs)) = await TryRequestAsync(() => isDownload + var (success, sizeFailed, (bps, durationMs)) = await TryRequestAsync(() => isDownload ? MeasureDownloadAsync(measurement.Bytes, cancellationToken, liveBps => Emit(progress, SpeedTestPhase.MeasuringDownload, pings, downloadBps, uploadBps, liveBps)) : MeasureUploadAsync(measurement.Bytes, cancellationToken), failures, cancellationToken, () => IsServerReachableAsync(cancellationToken)).ConfigureAwait(false); + // The server answers small requests, but requests of this size fail without a response: the remaining + // requests of the set would each wait for the timeout too + if (sizeFailed) + { + setSizeFailed = true; + break; + } + if (!success) continue; @@ -237,8 +246,9 @@ await TryRequestAsync(() => MeasureLatencyAsync(pings, cancellationToken), failu if (measurement.BypassMinDuration) continue; - // All requests of the set failed (e.g. a proxy rejects uploads of this size): the larger sizes would fail too - if (!setSucceeded || + // All requests of the set failed (e.g. a proxy rejects uploads of this size), or requests of this size fail + // without a response: the larger sizes would fail too + if (!setSucceeded || setSizeFailed || SpeedTestCalculator.IsDirectionFinished(setDurations, BandwidthFinishRequestDurationMs)) finished.Add(measurement.Type); } @@ -368,12 +378,13 @@ private static void EnsureSuccess(HttpResponseMessage response) /// times), another error skips the request. After /// failed requests in a row without a response the error is thrown (the test ends) - unless the server still /// answers a small request: then only this size fails (e.g. a proxy that closes the connection of large uploads - /// instead of answering HTTP 413) and the direction ends after the set. + /// instead of answering HTTP 413), the rest of the set is skipped and the direction ends. /// /// Checks whether the server answers (download / upload), null for the /// latency probes (they are small requests themselves). - /// false if the request failed and was skipped. - private static async Task<(bool Success, T Value)> TryRequestAsync(Func> request, + /// Success false if the request failed and was skipped, SizeFailed true if + /// requests of this size fail while the server answers small requests (skip the rest of the set). + private static async Task<(bool Success, bool SizeFailed, T Value)> TryRequestAsync(Func> request, RequestFailures failures, CancellationToken cancellationToken, Func> isServerReachable = null) { for (var retry = 0;; retry++) @@ -383,7 +394,7 @@ private static void EnsureSuccess(HttpResponseMessage response) var value = await request().ConfigureAwait(false); failures.Consecutive = 0; - return (true, value); + return (true, false, value); } catch (TooManyRequestsException ex) when (retry < MaxRetries) { @@ -407,13 +418,15 @@ private static void EnsureSuccess(HttpResponseMessage response) throw; // The connection works, only requests of this size fail: skip them (the set fails) - Log.Warn("Speed test requests of this size fail, but the server answers small requests."); + Log.Warn("Speed test requests of this size fail, but the server answers small requests.", ex); failures.Consecutive = 0; + + return (false, true, default); } Log.Warn("Speed test request failed and is skipped.", ex); - return (false, default); + return (false, false, default); } } } diff --git a/Website/docs/application/dashboard.md b/Website/docs/application/dashboard.md index a6513bc52d..f11f2ca09f 100644 --- a/Website/docs/application/dashboard.md +++ b/Website/docs/application/dashboard.md @@ -186,4 +186,4 @@ Right-click an IP address (public IP address, DNS server) to open it in the **Po - The local IP address is detected by the route to the [Public IPv4 address](#public-ipv4-address) / [Public IPv6 address](#public-ipv6-address) (no packet is sent), otherwise from the first active network interface. With several network adapters (e.g. LAN and VPN), set an address that is routed via the adapter you want to see. - The internet is shown as reachable if the [Public IPv4 address](#public-ipv4-address) / [Public IPv6 address](#public-ipv6-address) replies to the ping or the public IP address could be requested from `api.ipify.org` / `api6.ipify.org` (or the [custom API](#use-custom-ipv4-address-api)). If both are blocked (e.g. by a firewall, or websites are only reachable via a proxy), the internet is shown as a warning if Windows reports internet access (IPv4), otherwise as not reachable; use another public IP address / API. The IP geolocation and the DNS resolver are requested from `ip-api.com` (45 requests per minute, a request fails after 10 seconds without a response). - Without IPv6 connectivity (or no IPv6 from the internet provider), the IPv6 checks are shown as information (gray) and skipped, the IPv4 checks are not affected. -- The [Speed Test](#speed-test) measures the connection to the nearest Cloudflare server. A VPN, a proxy or other traffic on the network at the same time lowers the result. A request of the speed test fails after 15 seconds without a response or data (e.g. the connection was lost). Like the official library, a failed request is skipped (shown as a warning after the test) and a request that is rate limited by Cloudflare (HTTP 429) is repeated up to three times; if all requests of a size fail (e.g. a proxy rejects large uploads), the larger sizes of the direction are skipped. After three requests in a row without a response the test ends with the error, unless the server still answers a small request (e.g. a proxy closes the connection of large uploads): then the larger sizes of the direction are skipped. +- The [Speed Test](#speed-test) measures the connection to the nearest Cloudflare server. A VPN, a proxy or other traffic on the network at the same time lowers the result. A request of the speed test fails after 15 seconds without a response or data (e.g. the connection was lost). Like the official library, a failed request is skipped (shown as a warning after the test) and a request that is rate limited by Cloudflare (HTTP 429) is repeated up to three times; if all requests of a size fail (e.g. a proxy rejects large uploads), the larger sizes of the direction are skipped. After three requests in a row without a response the test ends with the error, unless the server still answers a small request (e.g. a proxy closes the connection of large uploads): then the remaining requests of this size and the larger sizes of the direction are skipped. diff --git a/Website/docs/changelog/next-release.md b/Website/docs/changelog/next-release.md index d2ffd5b44f..a4584a3da7 100644 --- a/Website/docs/changelog/next-release.md +++ b/Website/docs/changelog/next-release.md @@ -181,7 +181,7 @@ Release date: **xx.xx.2026** - Fixed the DNS resolver widget showing "Object reference not set to an instance of an object" when edns.ip-api.com answered with an empty response (e.g. a proxy). An empty response of ip-api.com is shown as an error in both widgets. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the offset of the IP geolocation widget being shown as `-/-` for locations in UTC+0 (e.g. London in winter) and in seconds (e.g. `3600`). It is shown as `UTC+01:00`. A region without a code is shown without empty brackets. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) - Fixed the IP geolocation widget showing an empty result when ip-api.com had no geolocation for the public IP address (e.g. behind a proxy). A warning shows the reason, like the IP Geolocation tool. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) -- Fixed the speed test ending with "Could not connect to speed.cloudflare.com" when a proxy closed the connection of large uploads (instead of rejecting them with an HTTP error). After three requests in a row without a response, the test only ends if the server doesn't answer a small request either; otherwise the larger sizes of the direction are skipped. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) +- Fixed the speed test ending with "Could not connect to speed.cloudflare.com" when a proxy closed the connection of large uploads (instead of rejecting them with an HTTP error). After three requests in a row without a response, the test only ends if the server doesn't answer a small request either; otherwise the remaining requests of this size and the larger sizes of the direction are skipped. [#3741](https://github.com/BornToBeRoot/NETworkManager/pull/3741) **Status window** From 2aaa5a14b6c0ec55de4587739e6f2d055299b092 Mon Sep 17 00:00:00 2001 From: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com> Date: Fri, 27 Nov 2026 18:01:04 +0100 Subject: [PATCH 33/43] Feature: Dashboard: Settings grouped by widget Settings > Dashboard has one section per widget in the order of the dashboard (Network connection, Speed Test, IP geolocation, DNS resolver), each with "Show widget" and the settings of its check. Showing a widget and enabling its check stay separate (a new installation shows the IP API widgets with the Enable button): "Check IP geolocation" / "Check DNS resolver" are disabled while their widget is hidden (the value is kept). A note shows that the network connection settings are also used by the status window, the help of the public IPv4 / IPv6 address says it is not the address of the computer. Docs: Settings section grouped the same way (existing anchors kept). Co-Authored-By: Claude Opus 5.5 --- .../Resources/Strings.Designer.cs | 49 ++++++++++--- .../Resources/Strings.resx | 19 +++-- .../Views/DashboardSettingsView.xaml | 69 +++++++++++++++---- Website/docs/application/dashboard.md | 66 ++++++++++++++---- Website/docs/changelog/next-release.md | 3 +- 5 files changed, 161 insertions(+), 45 deletions(-) diff --git a/Source/NETworkManager.Localization/Resources/Strings.Designer.cs b/Source/NETworkManager.Localization/Resources/Strings.Designer.cs index 0684546ab3..60163118bd 100644 --- a/Source/NETworkManager.Localization/Resources/Strings.Designer.cs +++ b/Source/NETworkManager.Localization/Resources/Strings.Designer.cs @@ -6555,7 +6555,7 @@ public static string HelpMessage_ProfileHostPlaceholder { } /// - /// Looks up a localized string similar to Public IPv4 address that is pinged to check the internet connection. The route to it is used to detect the local IPv4 address (of the network adapter that is used for the internet).. + /// Looks up a localized string similar to Public IPv4 address (not the one of your computer) that is pinged to check the internet connection. The route to it is used to detect the local IPv4 address (of the network adapter that is used for the internet).. /// public static string HelpMessage_PublicIPv4Address { get { @@ -6564,7 +6564,7 @@ public static string HelpMessage_PublicIPv4Address { } /// - /// Looks up a localized string similar to Public IPv6 address that is pinged to check the internet connection. The route to it is used to detect the local IPv6 address (of the network adapter that is used for the internet).. + /// Looks up a localized string similar to Public IPv6 address (not the one of your computer) that is pinged to check the internet connection. The route to it is used to detect the local IPv6 address (of the network adapter that is used for the internet).. /// public static string HelpMessage_PublicIPv6Address { get { @@ -6701,6 +6701,24 @@ public static string HelpMessage_ScanForNetBIOS { } } + /// + /// Looks up a localized string similar to Shows the widget on the dashboard. It only sends a request to ip-api.com if the check is enabled (below, in the welcome dialog or with the "Enable" button of the widget), otherwise it shows what it would request. A hidden widget sends no request.. + /// + public static string HelpMessage_ShowIPApiWidget { + get { + return ResourceManager.GetString("HelpMessage_ShowIPApiWidget", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shows the widget on the dashboard. The status window always shows the network connection.. + /// + public static string HelpMessage_ShowNetworkConnectionWidget { + get { + return ResourceManager.GetString("HelpMessage_ShowNetworkConnectionWidget", resourceCulture); + } + } + /// /// Looks up a localized string similar to Displays the status bar in the bottom-left of the WebView when hovering over a link.. /// @@ -9168,6 +9186,15 @@ public static string NetworkConnectionType { } } + /// + /// Looks up a localized string similar to The network connection widget and the status window use these settings to check the internet.. + /// + public static string NetworkConnectionWidgetAndStatusWindowUseTheseSettingsMessage { + get { + return ResourceManager.GetString("NetworkConnectionWidgetAndStatusWindowUseTheseSettingsMessage", resourceCulture); + } + } + /// /// Looks up a localized string similar to Network device. /// @@ -14250,6 +14277,15 @@ public static string ShowUnreachableIPAddressesAndPorts { } } + /// + /// Looks up a localized string similar to Show widget. + /// + public static string ShowWidget { + get { + return ResourceManager.GetString("ShowWidget", resourceCulture); + } + } + /// /// Looks up a localized string similar to Show window contents while dragging. /// @@ -16307,15 +16343,6 @@ public static string WideSubnet { } } - /// - /// Looks up a localized string similar to Widgets. - /// - public static string Widgets { - get { - return ResourceManager.GetString("Widgets", resourceCulture); - } - } - /// /// Looks up a localized string similar to Width. /// diff --git a/Source/NETworkManager.Localization/Resources/Strings.resx b/Source/NETworkManager.Localization/Resources/Strings.resx index d735533dd3..916fdb5aff 100644 --- a/Source/NETworkManager.Localization/Resources/Strings.resx +++ b/Source/NETworkManager.Localization/Resources/Strings.resx @@ -3090,10 +3090,10 @@ Enable profile file encryption in Settings>Profile to store credentials secur Enter a valid IPv6 address! - Public IPv4 address that is pinged to check the internet connection. The route to it is used to detect the local IPv4 address (of the network adapter that is used for the internet). + Public IPv4 address (not the one of your computer) that is pinged to check the internet connection. The route to it is used to detect the local IPv4 address (of the network adapter that is used for the internet). - Public IPv6 address that is pinged to check the internet connection. The route to it is used to detect the local IPv6 address (of the network adapter that is used for the internet). + Public IPv6 address (not the one of your computer) that is pinged to check the internet connection. The route to it is used to detect the local IPv6 address (of the network adapter that is used for the internet). Public IPv4 address @@ -5745,9 +5745,6 @@ Do you want to start the scan? Copy all - - Widgets - All widgets are hidden. You can show them in the settings of the dashboard. @@ -5771,4 +5768,16 @@ ip-api.com receives your IP address and the IP address of your DNS server. {0} has no IP geolocation for "{1}" ({2}). + + Show widget + + + Shows the widget on the dashboard. The status window always shows the network connection. + + + Shows the widget on the dashboard. It only sends a request to ip-api.com if the check is enabled (below, in the welcome dialog or with the "Enable" button of the widget), otherwise it shows what it would request. A hidden widget sends no request. + + + The network connection widget and the status window use these settings to check the internet. + \ No newline at end of file diff --git a/Source/NETworkManager/Views/DashboardSettingsView.xaml b/Source/NETworkManager/Views/DashboardSettingsView.xaml index bde05ddeb6..6494d29bbe 100644 --- a/Source/NETworkManager/Views/DashboardSettingsView.xaml +++ b/Source/NETworkManager/Views/DashboardSettingsView.xaml @@ -9,7 +9,30 @@ xmlns:validators="clr-namespace:NETworkManager.Validators;assembly=NETworkManager.Validators" mc:Ignorable="d" d:DataContext="{d:DesignInstance viewModels:DashboardSettingsViewModel}"> - + + + + + +