diff options
| author | Christian Cleberg <[email protected]> | 2026-07-20 15:33:50 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-07-20 15:52:46 -0500 |
| commit | 7b880ea410f37a7df22594ed9b268448621db4d8 (patch) | |
| tree | 90b1fe3489e291a0e0abf652caa3c7c52f59e31f /DomainDig/Models.swift | |
| parent | 8b661d9f36381ee432ece5e77a17d5ae6357d327 (diff) | |
| download | domain-dig-7b880ea410f37a7df22594ed9b268448621db4d8.tar.gz domain-dig-7b880ea410f37a7df22594ed9b268448621db4d8.tar.bz2 domain-dig-7b880ea410f37a7df22594ed9b268448621db4d8.zip | |
fix: report unreachable domains instead of 'No meaningful changes'
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.
Diffstat (limited to 'DomainDig/Models.swift')
| -rw-r--r-- | DomainDig/Models.swift | 8 |
1 files changed, 7 insertions, 1 deletions
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 } } |
