Repository navigation
fix: domain provider stats DNS records total matches per-domain display - #48
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
DomainCarddomain.record_count ?? stats.dns_records(Cloudflare-synced)stats.dns_recordsonly (entity_records filtered tomanaged=true)record_counton a newly-donated domain is populated from the scheduled Cloudflare sync (scheduledSync.js). If noDnsRecordentities withmanaged=trueexist yet (e.g. because the provider integration is new),stats.dns_recordsis 0 whilerecord_countalready reflects the real zone record count.Fix
One-line change in
server/domain-provider-routes.js— the totals reduce now usesd.record_count ?? d.stats.dns_records, matching exactly whatDomainCardrenders.Verification