fix(web): always render DNS records in custom domain setup - #2083
Open
richiemcilroy wants to merge 1 commit into
Open
fix(web): always render DNS records in custom domain setup#2083richiemcilroy wants to merge 1 commit into
richiemcilroy wants to merge 1 commit into
Conversation
The custom domain verify step could render with no DNS records and spin indefinitely. This happened when Vercel's config response omitted recommended records (e.g. domains not on Vercel DNS) or when the status check silently failed, since the UI only renders records from recommendedCNAME/recommendedIPv4 and polling suppresses error toasts. - checkDomainStatus now falls back to Vercel's well-known targets (cname.vercel-dns.com for subdomains, 76.76.21.21 for apex) when the config response has no recommendations, and logs server-side failures instead of swallowing them silently. - VerifyStep renders a fallback record card when no recommended records are present, and shows an explicit retry message when the config could not be loaded at all. - updateDomain normalizes the stored domain (trim + lowercase). - remove-domain uses a shared removeDomain helper for the Vercel call.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
| Authorization: `Bearer ${process.env.VERCEL_AUTH_TOKEN}`, | ||
| }, | ||
| }, | ||
| ).then((res) => res.json()); |
Contributor
There was a problem hiding this comment.
DELETE response requires JSON body
If Vercel returns an empty or non-JSON body for this DELETE request, res.json() rejects before removeOrganizationDomain clears the local domain fields, leaving the organization with stale custom-domain state even when the HTTP request completed.
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/actions/organization/domain-utils.ts
Line: 98
Comment:
**DELETE response requires JSON body**
If Vercel returns an empty or non-JSON body for this DELETE request, `res.json()` rejects before `removeOrganizationDomain` clears the local domain fields, leaving the organization with stale custom-domain state even when the HTTP request completed.
**Context Used:** AGENTS.md ([source](https://github.com/capsoftware/cap/blob/main/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
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.
Problem
The custom domain verify step could render with no DNS records and the Check Status button spun indefinitely. Repro path: set up a subdomain whose Vercel config response omits recommended records, or any transient failure in the status check (errors are swallowed and polling suppresses toasts).
Fix
checkDomainStatusfalls back to Vercel's well-known targets (cname.vercel-dns.comfor subdomains,76.76.21.21for apex domains) when the config response has no recommendations, and logs failures server-side instead of silently returning an empty result.VerifySteprenders a fallback record card when no recommended records come back, and shows an explicit retry message when the config fails to load entirely.updateDomainnormalizes the stored domain (trim + lowercase).remove-domainuses a sharedremoveDomainhelper for the Vercel API call.Testing
cname.vercel-dns.com) is displayed even if Vercel omits recommendations.Greptile Summary
The PR makes custom-domain verification display well-known Vercel DNS targets when recommendations are missing, adds an explicit configuration-load error state, normalizes newly stored domains, and extracts Vercel domain deletion into a shared helper.
Confidence Score: 4/5
The PR appears safe to merge, with one non-blocking response-handling issue in the extracted Vercel deletion helper.
The DNS fallback and normalization paths are internally consistent, but parsing every DELETE response as JSON can prevent local cleanup when Vercel returns a successful response without a JSON body.
Files Needing Attention: apps/web/actions/organization/domain-utils.ts
Important Files Changed
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix(web): always render DNS records in c..." | Re-trigger Greptile
Context used (3)