Skip to content

Conversation

@ameer2468
Copy link
Contributor

@ameer2468 ameer2468 commented Sep 1, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Updated custom domain verification to show CNAME record instructions only for subdomains. This prevents incorrect guidance for apex/root domains, reducing confusion and potential misconfigurations. Users should now see clearer, context-appropriate setup steps, leading to smoother verification and fewer errors.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 1, 2025

Walkthrough

Updated VerifyStep’s CNAME record visibility condition to additionally require the domain to be a subdomain. The flag showCNAMERecord now depends on hasRecommendedCNAME, not being already configured, and isSubdomain(domain). No exported APIs changed.

Changes

Cohort / File(s) Summary
VerifyStep CNAME visibility logic
apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx
Tightened condition for showing CNAME records: showCNAMERecord now requires hasRecommendedCNAME && !cnameConfigured && isSubdomain(domain) (previously lacked isSubdomain).

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant UI as VerifyStep Component
  participant H as Helpers

  U->>UI: Open Custom Domain Verify Step
  UI->>H: Compute hasRecommendedCNAME, cnameConfigured, isSubdomain(domain)
  H-->>UI: booleans
  alt Show CNAME section
    Note over UI: hasRecommendedCNAME && !cnameConfigured && isSubdomain(domain)
    UI-->>U: Render CNAME record instructions
  else Hide CNAME section
    UI-->>U: CNAME section omitted
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

I twitch my nose at DNS night,
Subdomains only—CNAMEs in sight.
A hop, a check, conditions three,
If all align, we set it free.
Burrowed deep in records true,
Verified domains—hip hop, woo! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch no-cname-for-domains

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ameer2468 ameer2468 merged commit 57c45f2 into main Sep 1, 2025
14 of 15 checks passed
@ameer2468 ameer2468 deleted the no-cname-for-domains branch September 1, 2025 12:08
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx (1)

382-386: Fix CNAME “Name” for multi-label subdomains (e.g., foo.bar.example.co.uk).

Using only the first label is incorrect; use the full subdomain via tldts.

Apply:

-              {domain.split(".").length > 2
-                ? domain.split(".")[0]
-                : "@"}
+              {(() => {
+                const { subdomain } = parse(domain);
+                return subdomain || "@";
+              })()}
🧹 Nitpick comments (3)
apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx (3)

53-55: Avoid mutating props-derived arrays when sorting IPv4 recommendations.

Sort a copy to prevent side effects.

-      const sortedIPv4 = recommendedIPv4.sort((a, b) => a.rank - b.rank);
+      const sortedIPv4 = [...recommendedIPv4].sort((a, b) => a.rank - b.rank);

391-394: Don’t mutate recommendedCnames during render.

Sort a cloned array.

-{recommendedCnames
-  .sort((a, b) => a.rank - b.rank)
+{[...recommendedCnames]
+  .sort((a, b) => a.rank - b.rank)
   .map((cname, index) => {

113-127: Tighten interval typing and effect deps to avoid stale closures.

Use ReturnType for browser/node compatibility and include checkVerification in deps.

-  let interval: NodeJS.Timeout;
+  let interval: ReturnType<typeof setInterval> | undefined;
@@
-    return () => {
-      clearInterval(interval);
-    };
-  }, [activeOrganization?.organization.customDomain, isVerified]);
+    return () => {
+      if (interval) clearInterval(interval);
+    };
+  }, [activeOrganization?.organization.customDomain, isVerified, checkVerification]);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9cdab1c and ad652d6.

📒 Files selected for processing (1)
  • apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
apps/web/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

apps/web/**/*.{ts,tsx}: Use TanStack Query v5 for client-side server state and data fetching in the web app
Mutations should call Server Actions and perform precise cache updates with setQueryData/setQueriesData, avoiding broad invalidations
Prefer Server Components for initial data and pass initialData to client components for React Query hydration

Files:

  • apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx
{apps/web,packages/ui}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

{apps/web,packages/ui}/**/*.{ts,tsx}: Use Tailwind CSS exclusively for styling in the web app and shared React UI components
Component naming: React components in PascalCase; hooks in camelCase starting with 'use'

Files:

  • apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use strict TypeScript and avoid any; prefer shared types from packages

Files:

  • apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build Desktop (aarch64-apple-darwin, macos-latest)
  • GitHub Check: Build Desktop (x86_64-pc-windows-msvc, windows-latest)
  • GitHub Check: Analyze (rust)
🔇 Additional comments (2)
apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx (2)

98-99: CNAME visibility correctly limited to subdomains — LGTM.

This aligns with DNS rules (no CNAME at the apex) and matches the A-record gating above.


1-4: Confirm this module is a Client Component.

It uses hooks; add 'use client' if not already present.

+'use client';
 import { LoadingSpinner } from "@cap/ui";

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.

2 participants