Not existing uid returns wrong document

We have a uid xyz which equals our url path. This uid (with getByUID) returns a document with the uid abc. This uid xyz doesn't exist in our documents. We also cannot create a new document with the uid xyz.
What's the issue?

Hi @prismic_tymeo

Thanks for reaching out,

I believe that the document with UID "xyz" has been renamed to be "abc," and that is why when you query by the "xyz," you get the "abc" document.

You can't create a document with "xyz" UID, and that has been done why desgn to avoid breaking old URL.

You can release those UID by renaming the document that old UID and here is trick to be able to use the old UID

1 Like