fix: pass region string directly in updateLaunchConfig.mjs instead of broken enum lookup#38
Merged
Conversation
… broken enum lookup
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
reeshika-h
approved these changes
Jun 30, 2026
harshitha-cstk
approved these changes
Jun 30, 2026
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
updateLaunchConfig.mjswas using a TypeScript enum reverse-lookup toresolve the region value:
region: Region[process.env.NEXT_PUBLIC_CONTENTSTACK_REGION]
The
Regionenum in@contentstack/delivery-sdkonly has three keys:EU, AZURE_EU, GCP_EU. Any other value — NA, azure-na, gcp-na, or even
lowercase eu — resolves to undefined, so the SDK was silently receiving
no region at all. Cache priming on Contentstack Launch deployments was
broken for every region except exact uppercase EU.
The app itself was unaffected at runtime since lib/contentstack.ts
already passed the string directly.
Fix
Drop the enum lookup, pass the env var string directly — the same
approach used everywhere else in the codebase. Also removed the now
unused Region import.