-
Notifications
You must be signed in to change notification settings - Fork 126
fix: correct criteria format for nlp value update #940
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
Conversation
WalkthroughThe update modifies the Changes
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🔇 Additional comments (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Motivation
The
handleValueCreate
method inNlpService
was attempting to update an NlpValue using:This resulted in the following runtime error:
The
updateOne
method in the base repository expects a filter object, such as:{ _id: value._id }
However, the code was incorrectly passing only the document's ID directly, not wrapped in an object.
Additionally, since value is a Mongoose document (NlpValueDocument), passing it without converting or wrapping can lead to unexpected behavior when matching criteria, especially if the repository expects plain JavaScript objects.
Moreover, the same thing is valid for the
handleEntityCreate
method inNlpService
. Furthermore, post-create is never triggered in theNlpEntityRepository
because of an invalid condition that is never true.Fixes # (934, 942)
Type of change:
Please delete options that are not relevant.
Checklist:
Summary by CodeRabbit
Bug Fixes
Chores