From ae2e1e5659eb78f5b72058585de2a0450597a0cb Mon Sep 17 00:00:00 2001 From: Alexandr Stelnykovych Date: Wed, 15 Oct 2025 17:17:47 +0300 Subject: [PATCH] fix: UI bug: when loading grouped connections from 'future' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit STR: 1. Network Activity View 2. Set "Search History" From/To dates in the future 3. Set "Group By" Domain Observed Result: - Infinite “Loading connections…” status. - The UI remains unresponsive to any changes in connection filters or reload actions. https://github.com/safing/portmaster/issues/2041 --- .../src/app/shared/netquery/netquery.component.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/desktop/angular/src/app/shared/netquery/netquery.component.ts b/desktop/angular/src/app/shared/netquery/netquery.component.ts index a09d18eb..458dc387 100644 --- a/desktop/angular/src/app/shared/netquery/netquery.component.ts +++ b/desktop/angular/src/app/shared/netquery/netquery.component.ts @@ -586,15 +586,17 @@ export class SfngNetqueryViewer implements OnInit, OnDestroy, AfterViewInit { // the the correct resulsts here which depend on whether or not // we're applying a group by. let totalCount = 0; - if (this.groupByKeys.length === 0) { - totalCount = response.totalCount[0].totalCount; - } else { - totalCount = response.totalCount.length; + if (response?.totalCount) { + if (this.groupByKeys.length === 0 ) { + totalCount = response.totalCount[0].totalCount; + } else { + totalCount = response.totalCount.length; + } } return { totalCount, - totalConnCount: response.totalConnCount, + totalConnCount: response?.totalConnCount || [], } }) ), @@ -633,7 +635,7 @@ export class SfngNetqueryViewer implements OnInit, OnDestroy, AfterViewInit { // reset the paginator with the new total result count and // open the first page. this.paginator.reset(result.response.totalCount); - this.totalConnCount = result.response.totalConnCount[0].totalConnCount; + this.totalConnCount = result.response?.totalConnCount[0]?.totalConnCount || 0; this.totalResultCount = result.response.totalCount; // update the current URL to include the new search