defaultValue
evaluation behavior should be the same in admin dashboard and local API
#2889
Replies: 3 comments 7 replies
-
I just want to add here @jmikrut the more Payload gets used, the bigger a problem you're going to have with any divergence between dashboard and API create/update/delete operations. As the Payload ecosystem grows you're going to be supporting more and more programmatic interactions with Payload data. If people are to migrate to Payload from another CMS, this is going to be particularly tricky. Probably more importantly, if you guys are currently working on some form of database/data migration behavior, IMO this will also become a really hairy issue. |
Beta Was this translation helpful? Give feedback.
-
Thanks @jmikrut I must have misunderstood a previous statement about defaultValue calculations... but I'm back to thinking this is just a bug then, I've been able to reproduce this in a simplified example with just a
Now if I run a The reason why I'm claiming this is a race condition is because if I add an async timeout to the beforeChange hook it reliably works via the
|
Beta Was this translation helpful? Give feedback.
-
Hey @ssyberg! We apologize for the late follow up on this - it's been a busy couple of months preparing for our 2.0 launch. But @jmikrut and I have gotten around to this and solved the issue with this PR here. We'll get this merged in shortly and this will be taken care of. Thanks for your patience and for bringing this to our attention! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
There's a rather lengthy discussion about this here: #2785
The upshot is there is a divergence in
defaultValue
evaluation between browser basedoperations
and those identicaloperations
via local API. I personally think this is actually a bug but I will defer to @jmikrut opinion that it is not (unless he is now convinced and wants to upgrade this to a bug 😉).Beta Was this translation helpful? Give feedback.
All reactions