Skip to content

Emails: fix inverted DNS requirements notice condition (DOTEMP-76) - #113886

Merged
jordesign merged 2 commits into
trunkfrom
ai/agent/dotemp-76-1787882494
Sep 1, 2026
Merged

Emails: fix inverted DNS requirements notice condition (DOTEMP-76)#113886
jordesign merged 2 commits into
trunkfrom
ai/agent/dotemp-76-1787882494

Conversation

@agent-sandbox-automattic

Copy link
Copy Markdown
Contributor

Fixes DOTEMP-76

Proposed Changes

  • Invert the has_wpcom_nameservers guard in DnsRequirementsNotice so the external-nameserver warning is shown when the domain uses external nameservers (i.e. has_wpcom_nameservers === false) and hidden when WordPress.com nameservers are already in use.
  • Add unit tests that cover the corrected behavior for both the WP.com-nameserver case and the external-nameserver case (including the DOMAIN_CONNECTION subtype variant).

Why are these changes being made?

The condition if (!has_wpcom_nameservers) return null was inverted: it suppressed the DNS warning exactly for the users who needed it (external nameservers) and displayed it incorrectly for users already on WordPress.com nameservers. The one-character change (! removed) restores the intended behavior.

Testing Instructions

  • Navigate to the Dashboard → Emails → Add forwarder screen.
  • Select a domain that uses external name servers (has_wpcom_nameservers: false).
    • Before: no warning was shown.
    • After: the "Your domain is using external name servers" DNS requirements notice is displayed.
  • Select a domain that uses WordPress.com name servers (has_wpcom_nameservers: true).
    • Before: the external-nameserver warning was incorrectly shown.
    • After: no warning is shown.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • For UI changes, have you tested the affected components in dark mode?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

Linear: DOTEMP-76

Co-authored-by: jordesign jordan.gillman@automattic.com

This PR was auto-generated by Agent Sandbox. Please review carefully before merging.

The `has_wpcom_nameservers` guard was negated, so the external-nameserver
warning was hidden for domains that actually needed it and shown for
domains already on WordPress.com nameservers. Invert the condition so the
notice appears only when the domain uses external nameservers.

Fixes DOTEMP-76

Co-authored-by: matticbot <matticbot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

@jordesign
jordesign marked this pull request as ready for review August 28, 2026 02:28
@jordesign
jordesign requested a review from a team as a code owner August 28, 2026 02:28
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 28, 2026
@jordesign

Copy link
Copy Markdown
Contributor

Tested that this causes correct behaviour for both domains using dotcom nameservers, and those using external namesevers.


export const DnsRequirementsNotice = ( { domainName, domainData }: DnsRequirementsNoticeProps ) => {
if ( ! domainData.has_wpcom_nameservers ) {
if ( domainData.has_wpcom_nameservers ) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems logical. @zaguiini can verify.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferring this to @Automattic/quake

@bogiii
bogiii requested a review from a team August 31, 2026 10:21

@bogiii bogiii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! 👍

Image

@jordesign
jordesign merged commit 3a58d4c into trunk Sep 1, 2026
12 checks passed
@jordesign
jordesign deleted the ai/agent/dotemp-76-1787882494 branch September 1, 2026 00:31
@github-actions github-actions Bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 1, 2026
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.

5 participants