Open icelandcruiser opened 1 week ago
I figured out the issue started with v1.7.0. The versions before that were fine. Oh and If I remove the defaultLanguages setting from sanity.config.ts, the latest version (3.0.1) works also...
I can confirm that this is indeed a bug. Potentially also slightly non-deterministic. I observed that it very occasionally works, but most of the time the values from initialValue
are not applied.
Might also be helpful to know that when supplying a function to initialValue
then that function is invoked even when the values don't end up being applied to the document.
True, I've also seen it work maybe 1 in 10 times or so for some documents, but not at all for others. It seems like there's a race condition during initialization.
When using Initial Value Templates (https://www.sanity.io/docs/initial-value-templates), the plugin appears to overwrite, remove, or ignore the initial values. This behavior occurs regardless of whether the initial values are defined directly within the document schema or via the structure builder. When a document includes one or more internationalized array fields, the initial values fail to persist.
To Reproduce
Expected behavior The addition of internationalized array fields should not affect initial values.
Which versions of Sanity are you using? Sanity: 3.60.0 sanity-plugin-internationalized-array: 3.0.1
What operating system are you using? macOS Sonoma 14.5
Which versions of Node.js / npm are you running? Node: 9.8.1 npm: v18.18.2