Conversation
…n circular references (#719) * fix(i18n-array): prevent stack overflow on circular schema * chore(test-studio): add repro schema to test studio
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
There was a problem hiding this comment.
Pull request overview
Hotfix for sanity-plugin-internationalized-array v4 to prevent stack overflows when scanning Sanity document schemas that contain circular inline object/array nesting, while keeping the existing “detect internationalizedArray* usage” behavior.
Changes:
- Add cycle detection to schema traversal in
hasInternationalizedArrayFieldto avoid infinite recursion. - Add a regression test covering circular inline object nesting.
- Bump plugin version to
4.0.7and document the patch in the changelog (plus a dev-studio repro schema).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/sanity-plugin-internationalized-array/src/utils/hasInternationalizedArrayField.ts | Adds a visited set to prevent infinite recursion when traversing circular schema graphs. |
| plugins/sanity-plugin-internationalized-array/src/utils/hasInternationalizedArrayField.test.ts | Adds a regression test ensuring circular nesting does not throw/overflow. |
| plugins/sanity-plugin-internationalized-array/package.json | Bumps package version from 4.0.6 to 4.0.7. |
| plugins/sanity-plugin-internationalized-array/CHANGELOG.md | Documents the 4.0.7 patch change and links the PR/commit. |
| dev/test-studio/src/internationalized-array/index.tsx | Adds a dev-studio schema setup to reproduce/validate the circular nesting scenario manually. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Description
Hotfix for i18n v4
What to review
Testing