Leaking of an unreleased change (type and content) breaks production site


We’ve got a production incident today because all of a sudden Prismic started to leak “Planned to release” type and content changes via the query API v2 and broke the production (old) version which was not expecting changes. We were working from DEV environment with the new release planning to release the CMS version along with the site version.

We worked normally for the whole day yesterday (after done the first changes) and today the new version became unduly available.

The change was in a defined release:

The last time the content was published was 19d ago:

But then, today, Prismic started to answer with 2 records (!) per “singleton types” (one for the published version and another for the yet to publish), all of them considering the new structure (the property ‘gif_banner’ is new and removed properties are already missing):

The query is a standard one:

What could be the cause, since we are following documentation and expecting to use Prismic versioning capability as stated here? https://user-guides.prismic.io/en/articles/380234-what-happens-when-you-change-your-custom-type

Hello Sérgio, welcome to the Prismic forum!

If I understand correctly, you are viewing changes made to documents in a release, in the production version of the site. is this correct?

This is very strange because the only way to see changes from a release in production is through Previews. This feature allows you to see unpublished changes (documents that are saved or added to a release), they can be viewed wherever you have configured the previews (they can be on the localhost in development mode or directly on the live site).

I have reviewed the endpoint of your repository and from what I see all the documents are correctly published. It has many fields, except the gif_banner field that you mentioned.

Something that caught my attention is that you mention using the versioning capability of the API V2. This means that you know that if you remove fields from your custom types, they will also automatically disappear from your documents. Did you intend to delete fields before publishing them?

Hello Paulina.

Your understanding of the problem is correct: the changes yet to be released have broken our production (version) site.

One additional point it is worth to mention is that through you api/v2 site, the contents are listed ok, but from the JavaScript SDK (our app is a Vue one), contents are listed as the image I posted (singletons doubled, with the last published version in position result[0] and the to-be-published one in position [1] - note that the standard position for getting singletons in normal situations is [0]). As you can see from the Json result, both versions are considered published and have the new structure.

Regarding your last statement (about removing fields in V2), the article leads to an (obvious and expected) understanding that the removal of the fields should only happen after the release got published - old version are kept untouched. Otherwise, every type change (with removal) would immediately break previously published contents and the very first statement of your article would be invalid:

“To be on the safe side, prismic.io will keep any existing data after a custom type has been modified”

If that isn’t true, maybe that is another problem by itself, meaning that one should keep track of structure changes apart from Prismic capabilities. If that only happens by using api/V1, anyone reading the article would think that such capacity is obsolete. We’ve just started using Prismic and the obvious decision/mindset is to go for V2. Please clarify further this point!

Anyway, now we are getting unreleased versions from SDK calls (maybe only after having changed related types).

This issue has been closed due to inactivity.