Skip to content

Conversation

@gagik
Copy link
Contributor

@gagik gagik commented Jan 8, 2026

This seems like the simplest way to hide it... That said I understand we don't want this kind of DE vs Compass logic and am open to alternatives.

This seems like the simplest way to hide it... That said I understand we don't want this kind of DE vs Compass logic and am open to alternatives.
@gagik gagik requested a review from a team as a code owner January 8, 2026 17:40
@gagik gagik requested review from Copilot and tculig and removed request for Copilot January 8, 2026 17:40
@gagik gagik changed the title chore: hide connection error in data explorer chore(compass-assistant): hide connection error in data explorer Jan 8, 2026
@gagik gagik changed the title chore(compass-assistant): hide connection error in data explorer chore(compass-assistant): hide connection error in data explorer COMPASS-9920 Jan 8, 2026
Copilot AI review requested due to automatic review settings January 13, 2026 12:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hides the connection error entry point for the MongoDB Assistant in Data Explorer while keeping it available in Compass. The change prevents the "Debug" button from appearing on connection errors in Data Explorer.

Changes:

  • Conditionally exclude interpretConnectionError when running in Data Explorer
  • Add optional chaining and guards to handle the undefined interpretConnectionError function
  • Skip E2E tests for connection error entry points when running in web/Data Explorer mode

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/compass-assistant/src/compass-assistant-provider.tsx Makes interpretConnectionError undefined for Data Explorer by checking appNameForPrompt
packages/compass-connections/src/stores/connections-store-redux.ts Adds optional chaining and existence checks for interpretConnectionError before use
packages/compass-assistant/src/compass-assistant-provider.spec.tsx Adds test coverage for Data Explorer not having interpretConnectionError
packages/compass-e2e-tests/tests/assistant.test.ts Skips connection error entry point tests in web/Data Explorer environment

Comment on lines +348 to +352
// interpretConnectionError is not available in Data Explorer
interpretConnectionError:
appNameForPrompt === APP_NAMES_FOR_PROMPT.DataExplorer
? undefined
: createEntryPointHandler(
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment states 'Data Explorer' but the code checks against APP_NAMES_FOR_PROMPT.DataExplorer. Consider updating the comment to reference the constant for consistency and to make it clear which exact value is being checked.

Copilot uses AI. Check for mistakes.
connectionInfo
? () => {
compassAssistant.interpretConnectionError({
compassAssistant.interpretConnectionError?.({
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This optional chaining is redundant since the condition on lines 1287-1289 already checks for interpretConnectionError existence. The function call is guaranteed to be defined at this point, so the ?. operator is unnecessary.

Suggested change
compassAssistant.interpretConnectionError?.({
compassAssistant.interpretConnectionError({

Copilot uses AI. Check for mistakes.
@lerouxb
Copy link
Contributor

lerouxb commented Feb 3, 2026

We can probably close this now that we have #7757 ?

@lerouxb lerouxb requested review from lerouxb and removed request for tculig February 4, 2026 14:09
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.

2 participants