How can getByUID can return a document with a different UID?

How is this possible? This is beyond me.

Hey @David_BISMUT,

Thanks for raising this, and welcome to our community!

As per our documentation:

When a UID value is changed, the old value is retained as a reference. The page can be queried using the previous UID until another page reuses it.

This is to prevent broken links :slight_smile: If you're trying to re-use this old UID, you need to duplicate the page returned by the API (histoire-de-flacon) and delete the original. It will free up the UID history. Let me know if you have any further questions on this!

Hi @zkeny this honestly feels like bad UX / DX. I can see the issue has been raised a lot, and the message returned by Prismic UI is cryptic. I understand you don’t want to break links, but the UID enforced by a new document should override any revision UID.

Hey @David_BISMUT, we agree! There's a feature request for this, we link every ticket to it so the product team is aware this is a recurring issue for users. I don't know when this will be addressed and how (structural change, better UI warnings, etc) but once I have more information I'll share details here :slight_smile:

1 Like