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: not check index exclusion path for null values #1330

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mrnagydavid
Copy link

This PR fixes issue #1327 🦕

Summary

Considering the following 4 types of index exclusions:

  1. excludeFromindexes: ['foo.*']
  2. excludeFromindexes: ['foo.bar']
  3. excludeFromindexes: ['foo[].*']
  4. excludeFromindexes: ['foo[].bar']

Supplying { entity: { foo: null } } throws for 2 and 3, but not for 1 and 4.

save({ excludeFromIndexes: ['foo.bar'], entity: { sho: 1, foo: null })
// throws TypeError: Cannot read properties of undefined (reading 'properties')

save({ excludeFromIndexes: ['foo[].*'], entity: { sho: 1, foo: null })
// throws TypeError: Cannot read properties of undefined (reading 'values')

With the changes in this PR, the save calls will not throw in any of the 4 cases.

@mrnagydavid mrnagydavid requested review from a team as code owners October 4, 2024 09:39
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: datastore Issues related to the googleapis/nodejs-datastore API. labels Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/nodejs-datastore API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant