-
Notifications
You must be signed in to change notification settings - Fork 251
chore(compass-assistant): hide connection error in data explorer COMPASS-9920 #7694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
There was a problem hiding this 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
interpretConnectionErrorwhen running in Data Explorer - Add optional chaining and guards to handle the undefined
interpretConnectionErrorfunction - 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 |
| // interpretConnectionError is not available in Data Explorer | ||
| interpretConnectionError: | ||
| appNameForPrompt === APP_NAMES_FOR_PROMPT.DataExplorer | ||
| ? undefined | ||
| : createEntryPointHandler( |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
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.
| connectionInfo | ||
| ? () => { | ||
| compassAssistant.interpretConnectionError({ | ||
| compassAssistant.interpretConnectionError?.({ |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
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.
| compassAssistant.interpretConnectionError?.({ | |
| compassAssistant.interpretConnectionError({ |
|
We can probably close this now that we have #7757 ? |
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.