Skip to content

fix: domain provider stats DNS records total matches per-domain display - #48

Merged
andrewstech merged 1 commit into
mainfrom
fix/domain-provider-stats-dns-records
Oct 23, 2026
Merged

andrewstech merged 1 commit into
mainfrom
fix/domain-provider-stats-dns-records

Conversation

@christopher-od

Copy link
Copy Markdown
Contributor

Bug

The "DNS Records" summary card showed 0 while the per-domain breakdown correctly showed the synced Cloudflare count (e.g. 388 for is-not-a.dev).

Root cause

Two different data sources were used for the same stat:

Location Source
Per-domain DomainCard domain.record_count ?? stats.dns_records (Cloudflare-synced)
Summary totals (backend) stats.dns_records only (entity_records filtered to managed=true)

record_count on a newly-donated domain is populated from the scheduled Cloudflare sync (scheduledSync.js). If no DnsRecord entities with managed=true exist yet (e.g. because the provider integration is new), stats.dns_records is 0 while record_count already reflects the real zone record count.

Fix

One-line change in server/domain-provider-routes.js — the totals reduce now uses d.record_count ?? d.stats.dns_records, matching exactly what DomainCard renders.

Verification

  • 283 / 283 tests pass
  • ESLint clean

The summary cards showed 0 DNS records while the per-domain breakdown
correctly showed the synced Cloudflare count (e.g. 388 for is-not-a.dev).

Root cause: the backend totals aggregated stats.dns_records (entity_records
query filtered to managed=true), while DomainCard in the frontend rendered
domain.record_count ?? stats.dns_records — two different sources.

Fix: the totals reduce now uses (d.record_count ?? d.stats.dns_records),
matching exactly what the per-domain UI displays.
@andrewstech
andrewstech merged commit c048c34 into main Oct 23, 2026
2 checks passed
@andrewstech
andrewstech deleted the fix/domain-provider-stats-dns-records branch October 23, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant