MWPW-191949: maybe taking care of langfirst=false bug#5914
MWPW-191949: maybe taking care of langfirst=false bug#5914sheridansunier wants to merge 2 commits into
Conversation
|
This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. If a test absolutely can not pass for a good reason, please add a comment with an explanation to the PR. |
|
This PR has not been updated recently and will be closed in 7 days if no action is taken. Please ensure all checks are passing, https://github.com/orgs/adobecom/discussions/997 provides instructions. If the PR is ready to be merged, please mark it with the "Ready for Stage" label. |
48225b3 to
fca79dd
Compare
Tests verify the core fix — getConfig() uses getLanguageFirstCountryAndLang (Lingo site-mapping lookup) for the getLangFirstParam call, not the generic Milo locale. Covers three cases: - Known Lingo locale (/de/ mapped to hawks) → &langFirst=true - Unknown locale (/jp/ not in mapping) → &langFirst=false - News source always → &langFirst=true (override unchanged, MWPW-191949) Also adds .specify/* to .gitignore for local-only speckit artifacts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
c45004d to
3b13a48
Compare
|
This PR has not been updated recently and will be closed in 7 days if no action is taken. Please ensure all checks are passing, https://github.com/orgs/adobecom/discussions/997 provides instructions. If the PR is ready to be merged, please mark it with the "Ready for Stage" label. |
|
Closing this PR due to inactivity. |
Summary
getConfig()inlibs/blocks/caas/utils.jswas resolving country/lang via the Milo locale system (getCountryAndLang). On LangFirst pages, Milo strips the country from the URL prefix (e.g./de/→country='de', lang='en'), while the Lingo mapping correctly returnslang='de', country='xx'— the pair that passes theisPermittedLingoSiteLocalecheck. This causedgetLangFirstParamto returnfalse, so the CaaS URL included&langFirst=falseinstead of&langFirst=true.getConfig()now resolves country/lang viagetLanguageFirstCountryAndLang(pathname, primeSource, fqdn)— a Lingo site-mapping lookup — before callinggetLangFirstParam.-fg-{color}suffix) instead of relying solely on the dropdown, and warms the lingo mapping cache before the publish loop viainitBulkPublisherLingoMapping().runLanguageFirstRetry— retries the lingo mapping lookup up to 3× when it fails transiently (indicated byfromFallback: true), preventing silentlangFirst=falseon network blips.fetchLingoSiteMapping()deduplicates thelingo-site-mapping.jsonnetwork call to one Promise per session.Before / After
/de/bacom page with<meta langfirst=on>&langFirst=false❌&langFirst=true✅/jp/)&langFirst=false&langFirst=false(unchanged)source: news&langFirst=true&langFirst=true(unchanged)Changes
libs/blocks/caas/utils.jsgetConfig()now callsgetLanguageFirstCountryAndLanginstead ofgetCountryAndLangfor langFirst resolution. Also: lingo mapping cache (fetchLingoSiteMapping),fromFallbackpropagation,state.floodgateColorreplaces hardcoded'pink',localFirst/localLastsort options, current-page UUID inexcludedIdstools/send-to-caas/send-utils.jsLANG_FIRST_SOURCE_MAPPINGSconstant;getFloodgateColorFromHost();processRepoForFloodgatehandles-fg-{color};runLanguageFirstRetry()with retry logictools/send-to-caas/bulk-publish-to-caas.jsfloodgateColorfrom host; callsinitBulkPublisherLingoMapping()before looptest/blocks/caas/utils.test.js&langFirst=true, unknown locale →&langFirst=false, news source always →&langFirst=trueConstitution Check
fetchLingoSiteMappingcaches the Promise; N→1 fetch per sessionlangFirstresolutionrunLanguageFirstRetry,getFloodgateColorFromHost,initBulkPublisherLingoMapping, and thegetConfig()langFirst path (including news source) are all coveredtags/severity; no PIITest plan
Automated
npm run test— 3377 passed, 0 failednpx eslinton changed files — cleangetConfig()with mocked lingo mapping:/de/(known lingo locale) →&langFirst=truegetConfig()with mocked lingo mapping:/jp/(unknown locale) →&langFirst=falsegetConfig()withsource: ['news']→&langFirst=true(news override unchanged)runLanguageFirstRetry(4 cases),getFloodgateColorFromHost(4 cases),initBulkPublisherLingoMapping(cache-overwrite)Manual smoke test
business.adobe.com/de/resources.htmlin DevTools → Network → filtered "chimera". Confirmedlangfirstmeta isonand both CaaS collection requests contain&langFirst=true✅Repro steps for reviewer: On
business.adobe.com/de/resources.html(or any bacom LangFirst page), open DevTools → Network → filter "chimera". Confirm&langFirst=trueappears in the CaaS request URL. Without this fix, the same page returns&langFirst=false.Suggested reviewer checks
<meta name="langfirst">. ConfirmlangFirstis absent from the CaaS URL entirely.langFirstis not incorrectlytrue.lingo-site-mapping.jsonrequest fires in the Network tab.-fg-pinkAEM branch host, open the bulk publisher and confirm the floodgate color is pre-populated as'pink'without manual selection.floodgateColordefault: On a non-floodgate host, confirmaddFloodgateHeaderdoes not send anx-floodgate-colorheader.🤖 Generated with Claude Code