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(docstore/mongodocstore): check length of sets in newUpdateDoc function #3394

Merged
merged 1 commit into from
Mar 2, 2024
Merged

fix(docstore/mongodocstore): check length of sets in newUpdateDoc function #3394

merged 1 commit into from
Mar 2, 2024

Conversation

bartventer
Copy link
Contributor

@bartventer bartventer commented Mar 2, 2024

This PR resolves issue #3393.

This update modifies the newUpdateDoc function in the docstore/mongodocstore package to check the length of the 'sets' variable before adding the '$set' field to the 'updateDoc' map. This prevents an error when calling the update function with only 'unset' or 'inc' modifiers and no 'set' modifiers.

…ction

This update modifies the newUpdateDoc function in the docstore/mongodocstore package to check the length of the 'sets' variable before adding the '$set' field to the 'updateDoc' map. This prevents an error when calling the update function with only 'unset' or 'inc' modifiers and no 'set' operations. This change improves the flexibility and robustness of the update function.

Resolves #3393
Copy link

codecov bot commented Mar 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.15%. Comparing base (7750aa6) to head (b855eb6).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3394   +/-   ##
=======================================
  Coverage   73.15%   73.15%           
=======================================
  Files         113      113           
  Lines       14848    14849    +1     
=======================================
+ Hits        10862    10863    +1     
  Misses       3213     3213           
  Partials      773      773           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@vangent vangent left a comment

Choose a reason for hiding this comment

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

Thanks for the repro and fix!

@vangent vangent merged commit 11b07b1 into google:master Mar 2, 2024
5 checks passed
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