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: check for valid schema before querying by constrained field #75

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

Conversation

matthewmcneely
Copy link
Member

Description
This PR fixes #74. If querying (modusDB.Get) for a struct's constrained field before the schema contained that type, the worker would panic (the bug contains that trace). This change ensures the schema contains the type before launching the query. Note that querying by uid does not suffer from this issue as the discovery of the tablets (groups) are not involved in the query.

Also added tests (as well as expanding existing unit tests) and changed the api file to use errors.New instead of the fmt package as no formatting was being applied.

Checklist

  • Code compiles correctly and linting passes locally
  • For all code changes, an entry added to the CHANGELOG.md file describing and linking to
    this PR
  • Tests added for new functionality, or regression tests for bug fixes added as applicable

Add/update tests; use errors.New instead of fmt.Errorf
@matthewmcneely matthewmcneely requested a review from a team as a code owner February 21, 2025 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Querying for non-existent record by constrained field panics
2 participants