Skip to content

Fix: TypeError in matchConnection for enterprise connections with no domains#2736

Open
ankita10119 wants to merge 5 commits intomasterfrom
SDK-7978
Open

Fix: TypeError in matchConnection for enterprise connections with no domains#2736
ankita10119 wants to merge 5 commits intomasterfrom
SDK-7978

Conversation

@ankita10119
Copy link
Contributor

@ankita10119 ankita10119 commented Mar 9, 2026

Changes

Added List() as a default fallback to x.get('domains')

return x.get('domains', List()).contains(target);

This returns an empty Immutable List when domains is absent, making .contains() return false safely instead of throwing.

References

Closes #2733

Testing

Running the test suite after the fix revealed that cheerio v1.2.0 (a transitive dependency via enzyme) had broken all Jest tests due to an ESM/CommonJS incompatibility. These changes were required to restore the test suite and are not related to the bug fix itself:

  • moduleNameMapper in Jest config - redirects cheerio imports to the CJS build (jsdom's browser export condition was resolving cheerio to its ESM build, which Jest cannot parse), maps the removed cheerio/lib/utils path to its new location, and stubs undici (pulled in by cheerio's CJS build for HTTP fetch, unavailable in jsdom)
  • src/__tests__/__mocks__/undici.js - minimal stub for undici
  • testPathIgnorePatterns - excludes __mocks__/ from Jest test discovery

Checklist

@ankita10119 ankita10119 requested a review from a team as a code owner March 9, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error thrown for enterprise connection with no domains configured

1 participant