Skip to content

fix(compass-indexes): fetch search indexes on refresh #7196

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

addaleax
Copy link
Collaborator

Instead of fetching regular indexes twice, fetch regular and search indexes once each, as was most likely the intention here.

Description

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

Instead of fetching regular indexes twice, fetch regular and search indexes
once each, as was most likely the intention here.
@Copilot Copilot AI review requested due to automatic review settings August 13, 2025 19:54
@addaleax addaleax requested a review from a team as a code owner August 13, 2025 19:54
@github-actions github-actions bot added the fix label Aug 13, 2025
Copy link
Contributor

@Copilot 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 fixes a bug in the compass-indexes plugin where the refresh functionality was incorrectly fetching regular indexes twice instead of fetching both regular and search indexes once each.

  • Corrects duplicate fetchRegularIndexes() call to fetchSearchIndexes() in the refresh handler
  • Ensures search indexes are properly refreshed when search indexes are supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -143,7 +143,7 @@ export function activateIndexesPlugin(
on(globalAppRegistry, 'refresh-data', () => {
void store.dispatch(fetchRegularIndexes());
if (options.isSearchIndexesSupported) {
void store.dispatch(fetchRegularIndexes());
void store.dispatch(fetchSearchIndexes());
Copy link
Preview

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

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

The fix correctly addresses the bug where regular indexes were being fetched twice instead of fetching search indexes. This ensures both regular and search indexes are properly refreshed when supported.

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@lerouxb lerouxb left a comment

Choose a reason for hiding this comment

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

Oops. That must have been my fault.

@gribnoysup gribnoysup added no release notes Fix or feature not for release notes no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) and removed no release notes Fix or feature not for release notes labels Aug 15, 2025
@gribnoysup
Copy link
Collaborator

Sorry, I think enabling required checks did something weird to some of the PRs, pushed an empty commit to retrigger the CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants