Dashboard › cli › Distillation
4596c4e5-b51f-4769-80b5-7d780ff3423f["lore_tm_v1_Gta-quKIK2gE-kNDlwj_7DpfoVfXNs_RchjXHwIbLuI"]
Date: Sep 10, 2026
packages/cli/src/lib/region.ts:16-100 defines an in-process regionCache: Map<string, Promise<string>> keyed by orgSlug. resolveOrgRegion(orgSlug) returns an existing in-flight/resolved promise, otherwise caches resolveOrgRegionUncached(orgSlug); it evicts rejected promises via promise.catch(() => regionCache.delete(orgSlug)), allowing retries after authentication failures.resolveOrgRegionUncached(orgSlug) in packages/cli/src/lib/region.ts:65-101 first checks SQLite with getOrgRegion(orgSlug), then uses getApiBaseUrl() and getSdkConfig(baseUrl) to call SDK getOrganization({ ...config, path: { organization_id_or_slug: orgSlug } }) under withAuthGuard. It throws response.error for auth discrimination, derives response.data?.links?.regionUrl ?? baseUrl, persists/trust-registers the result through setOrgRegion(orgSlug, regionUrl), propagates auth errors, and falls back to baseUrl for other errors including network and 404.packages/cli/src/lib/region.ts:103-114 implements isMultiRegionEnabled(): it obtains baseUrl via getConfiguredSentryUrl() and returns false when an explicitly configured URL is not a Sentry SaaS URL according to isSentrySaasUrl(baseUrl); otherwise it returns true.packages/cli/src/lib/region.ts are getOrganization from @sentry/api; getConfiguredSentryUrl; getOrgByNumericId, getOrgRegion, and setOrgRegion; stripDsnOrgPrefix; withAuthGuard; getApiBaseUrl and getSdkConfig; and isSentrySaasUrl.