feat: auto-detect unreachable base URL at onboarding and persist working variant as overrideBaseURL#2580
feat: auto-detect unreachable base URL at onboarding and persist working variant as overrideBaseURL#2580tkotthakota-adobe wants to merge 3 commits into
Conversation
…riant as overrideBaseURL
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Hey @tkotthakota-adobe,
Verdict: Request changes - concurrent fire-and-forget saves create a race condition that can silently drop config mutations.
Changes: adds a reachability probe at site creation to auto-detect and persist a working www-toggled overrideBaseURL when the registered base URL is unreachable (3 files).
Must fix before merge
- [Important] Race condition between concurrent fire-and-forget saves -
src/controllers/sites.js:406(details inline)
Non-blocking (3): minor issues and suggestions
- nit:
isUrlReachablereturnstruefor any HTTP response including 4xx/5xx - the intent is to detect "no listener", so this is arguably correct, but checkingresponse.okwould avoid setting overrideBaseURL on domains that respond with parking pages or blanket 403s -src/support/rum-config-service.js:82 - suggestion: Extract protocol from original
baseURLinstead of hardcodinghttps://when constructingtoggledURL, so the probe works correctly for sites registered withhttp://-src/support/rum-config-service.js:118 - suggestion:
autoDetectOverrideBaseURLhas no relationship to RUM configuration - consider moving to its own module (e.g.,src/support/base-url-detection.js) for discoverability -src/support/rum-config-service.js:92
Skill: pr-review | Model: us.anthropic.claude-opus-4-6-v1[1m] | Duration: 1m 24s | Cost: $3.88 | Commit: fb8f043a3ee3af29f38c6d9982f43a21be1b28fa
If this code review was useful, please react with 👍. Otherwise, react with 👎.
|
This PR will trigger no release when merged. |
There was a problem hiding this comment.
Hey @tkotthakota-adobe,
Verdict: Comment - all prior findings addressed, no blocking issues remain.
Changes: adds a reachability probe at site creation to auto-detect and persist a working www-toggled overrideBaseURL when the registered base URL is unreachable (4 files).
Non-blocking (3): minor issues and suggestions
- nit: Missing test for malformed baseURL path (the 1 line codecov flags) - a test passing e.g.
'not-a-url'as baseURL would cover thecatchat line 61 trivially -src/support/base-url-detection.js:61 - nit: Test "no-ops when baseURL returns non-ok response" asserts
calledTwicebut does not assertsite.savewas NOT called - worth adding for parity with the other no-op tests -test/support/base-url-detection.test.js:223 - suggestion:
toggledURLis constructed as${protocol}//${toggledHostname}, dropping any path from the original baseURL - if a site is registered with a path (e.g.https://www.example.com/site), the probe tests bare domain instead - likely intentional given the domain-level nature of the check, but worth a one-line comment confirming the design choice -src/support/base-url-detection.js:76
Previously flagged, now resolved
- Race condition between concurrent fire-and-forget saves - now chained sequentially via
.then() isUrlReachableaccepted any HTTP response as reachable - now gates onresponse.ok- Hardcoded
https://when constructing toggled URL - now extracts protocol from original baseURL - Auto-detect logic co-located in rum-config-service - extracted to dedicated
base-url-detection.jsmodule
Skill: pr-review | Model: us.anthropic.claude-opus-4-6-v1[1m] | Duration: 0m 53s | Cost: $2.63 | Commit: 6ee2c66b3ec0e7b6e7d3ba62a49fbc5b69a7cc4c
If this code review was useful, please react with 👍. Otherwise, react with 👎.
https://jira.corp.adobe.com/browse/SITES-46284
Problem and Fix:
When a site like dupont.com is onboarded with an unreachable base URL, the platform had no way to detect this at registration time. Every subsequent audit would silently fail trying to reach an unreachable domain. The fix adds a reachability probe at site creation — if the registered base URL fails but the www-toggled variant responds, it automatically saves the working URL as overrideBaseURL in the site config so all future audits use the correct domain from
the start.