You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code works as expected on 3.8.x but fails for arrays of refs on 4.0.0-rc2 resulting in a caster validation error before the setter is reached.
I believe I have traced the issue to this commit: 9ba0fb5 which applies caster setters for each object in an array before performing the setter on the array itself. I am not familiar enough with the code to know whether or not this was intentional, however it does break the above plugin.
I fixed this issue by removing the early return and placing the array caster setters after the path setters. I will submit a PR, but this may need input from the devs/original commiter regarding the implications of changing the order of operations here.
The text was updated successfully, but these errors were encountered:
I have a depopulate plugin so that I can call .set on a document with a populated object and avoid casting errors.
This code works as expected on 3.8.x but fails for arrays of refs on 4.0.0-rc2 resulting in a caster validation error before the setter is reached.
I believe I have traced the issue to this commit: 9ba0fb5 which applies caster setters for each object in an array before performing the setter on the array itself. I am not familiar enough with the code to know whether or not this was intentional, however it does break the above plugin.
I fixed this issue by removing the early return and placing the array caster setters after the path setters. I will submit a PR, but this may need input from the devs/original commiter regarding the implications of changing the order of operations here.
The text was updated successfully, but these errors were encountered: