Skip to content
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

fix: partial index are updated during startup #437

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

Conversation

flower-of-the-bridges
Copy link
Member

Pull Request Type

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Description

This PR resolves a bug that prevented the partial index from being updated when the user changed the filter expression.

PR Checklist

  • The commit message follows our guidelines included in the CONTRIBUTING.md
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

function checkIndexEquality(foundIndex, index) {
const isOptionUniqueEqual = index.unique ? foundIndex.unique === true : foundIndex.unique === undefined
const isOptionUniqueEqual = Boolean(index.unique) === Boolean(foundIndex.unique)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it correct that isOptionUniqueEqual is set to true whenever both properties have a falsy value?

In theory, the outcome should be true in case both values are either true or undefined. However, when both are set to false, the expression would be evaluated to true, leading to an incorrect behavior 🤔

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