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
In scenario where there's two documents with an identical slug field present in Sanity Studio, neither document can be patched via the HTTP mutations API, despite the documents having different IDs.
In my setup Sanity content is supposed be synced from a Shopify store using webhooks. The syncing works in all cases except in this case where there's two documents with same slug.
Example snippet from my API where I try force setting a new slug for the document in Sanity.
As to why there are products with duplicate slug values, it's a result of switching to different Shopify store which had cloned all product data from previous store, so now there's duplicate products with duplicate slugs, neither of which can be deleted, and the new products can't be published either because of the duplicate slug validation error.
As to why the old duplicate documents aren't deleted, it's because of another bug where Sanity thinks there are existing references elsewhere in Studio referencing this document, even if all other referenced are deleted.
A clear and concise description of what the bug is.
In scenario where there's two documents with an identical slug field present in Sanity Studio, neither document can be patched via the HTTP mutations API, despite the documents having different IDs.
In my setup Sanity content is supposed be synced from a Shopify store using webhooks. The syncing works in all cases except in this case where there's two documents with same slug.
Example snippet from my API where I try force setting a new slug for the document in Sanity.
When console-logging
handle
it in fact has the new, correct value as edited in Shopify.I also tried to unset the field, but that didn't work either:
As to why there are products with duplicate slug values, it's a result of switching to different Shopify store which had cloned all product data from previous store, so now there's duplicate products with duplicate slugs, neither of which can be deleted, and the new products can't be published either because of the duplicate slug validation error.
As to why the old duplicate documents aren't deleted, it's because of another bug where Sanity thinks there are existing references elsewhere in Studio referencing this document, even if all other referenced are deleted.
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect to be able to either patch or delete the document.
Screenshots
Which versions of Sanity are you using?
$ sanity versions
@sanity/cli 2.30.0 (latest: 3.1.2)
@sanity/base 2.30.0 (latest: 2.35.2)
@sanity/cli 2.30.0 (latest: 3.1.2)
@sanity/code-input 2.35.0 (latest: 3.0.1)
@sanity/color-input 2.30.0 (latest: 3.0.1)
@sanity/components 2.14.0 (up to date)
@sanity/core 2.30.0 (latest: 2.35.0)
@sanity/dashboard 2.30.1 (latest: 3.1.1)
@sanity/default-layout 2.30.0 (latest: 2.35.2)
@sanity/default-login 2.30.0 (latest: 2.35.2)
@sanity/desk-tool 2.30.0 (latest: 2.35.2)
Windows 10, MacOS
Which versions of Node.js / npm are you running?
8.19.2
v19.0.1
Additional context]
See:
ndimatteo/HULL#116
#1850
The text was updated successfully, but these errors were encountered: