Pre-validate hooks not running #1814
Labels
bug
Something isn't working
contribute
free for contributors to pick up
P2
planned for next 1-2 months
Due to the new usage of
findByIdAndUpdate
, certain pre-validate and pre-save hooks are not running asfindByIdAndUpdate
does not activate them. For example, the Form model has a check to ensure that the total form size does not exceed 10MB, but this check does not run when the Settings page is updated as the settings update usesfindByIdAndUpdate
. The Verification model also has a check for duplicate field IDs which is not run when Verification documents are updated.The following fixes should be made to ensure that the functionality in the hooks is maintained:
fields
key.findByIdAndUpdate
andfindOneAndUpdate
should be checked to ensure that the models do not rely on Mongoose hooks to maintain the correct state.The text was updated successfully, but these errors were encountered: