From 7b880ea410f37a7df22594ed9b268448621db4d8 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Mon, 20 Jul 2026 15:33:50 -0500 Subject: fix: report unreachable domains instead of 'No meaningful changes' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #10. resolvedSnapshotAfterFallback replaces a failed lookup's snapshot with the previous one, so alertDescriptor compared the old snapshot against itself, found matching hashes, and the run reported 'No meaningful changes' for a domain that was never actually reached. Nothing in the UI or the monitoring log distinguished that from a genuine no-change. MonitoringDomainResult now carries unreachableReason, set when the fallback fires. It is Optional so already-persisted monitoring logs still decode. The run summary reads 'Could not check — kept the previous result' with the underlying error, and monitoringEvents emits a warning- severity monitoringFailure so configured integrations hear about it rather than seeing silence. --- DomainDig/Models.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'DomainDig/Models.swift') diff --git a/DomainDig/Models.swift b/DomainDig/Models.swift index b86fc07..6989cba 100644 --- a/DomainDig/Models.swift +++ b/DomainDig/Models.swift @@ -1544,6 +1544,10 @@ struct MonitoringDomainResult: Codable, Identifiable, Equatable { let certificateWarningLevel: CertificateWarningLevel let resultSource: LookupResultSource let errorMessage: String? + /// Non-nil when the lookup failed and the previous snapshot was reused, so + /// this run compared the old data against itself and cannot claim the + /// domain is unchanged. Optional so already-persisted logs still decode. + let unreachableReason: String? init( id: UUID = UUID(), @@ -1555,7 +1559,8 @@ struct MonitoringDomainResult: Codable, Identifiable, Equatable { alertSeverity: MonitoringAlertSeverity?, certificateWarningLevel: CertificateWarningLevel, resultSource: LookupResultSource, - errorMessage: String? = nil + errorMessage: String? = nil, + unreachableReason: String? = nil ) { self.id = id self.domain = domain @@ -1567,6 +1572,7 @@ struct MonitoringDomainResult: Codable, Identifiable, Equatable { self.certificateWarningLevel = certificateWarningLevel self.resultSource = resultSource self.errorMessage = errorMessage + self.unreachableReason = unreachableReason } } -- cgit v1.2.3