Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(document): fire pre validate hooks on 5 level deep single nested subdoc when modifying after save() #14604

Merged
merged 1 commit into from
May 24, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #14591

Summary

Tricky issue: if you save() a doc, then set() a more than 3 level nested single nested path using dot notation, pre('validate') hooks don't fire because the subdoc paths aren't marked as modified beyond the 1st level.

This PR provides a reasonable fix for this particular case, but I will look more closely at how our change tracking handles subdocs as a followup to this work.

Examples

@vkarpov15 vkarpov15 added this to the 8.4.1 milestone May 17, 2024
@vkarpov15 vkarpov15 merged commit 2a8c532 into master May 24, 2024
34 checks passed
@hasezoey hasezoey deleted the vkarpov15/gh-14591 branch May 24, 2024 14:29
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pre validate: is not triggert on all sub documents when set via _.set() with a nested path
2 participants