Languages reorder crash the field on the published document
Describe the bug
I integrated Sanity with another CMS to pull translations from it. So I've faced with the problem that I can't see my published document. After my investigation I found the problem in sorting algorytm.
To Reproduce
- Create a release in Sanity
- Push the document with random langugage order in this release with API
- Do not open the version of this document befor release
- Publish the release
- Open published document
Expected behavior
I can see published document in sanity
Screenshots
Which versions of Sanity are you using?
3.98.0
What operating system are you using?
MacOS 15.5
Which versions of Node.js / npm are you running?
10.2.4
Additional context
I guess the problem in this funcion
This is causing major issues.
Did you find a workaround?
Yes, I found. I requested all documents in sanity, and then updated them with RIGHT sorted i18n arrays. By the way, now I check sorting every time when I update sanity with external CMS data