API returning stale data, incorrect document type fields

Is there an issue with Prismic at the moment? Everything seemed to be working okay and suddenly all of my queries are returning stale data. Field values changed and published are not being correctly brought down with Client().query with or without Predicates.

Hello Ashley, thanks for reaching out about this. We did had an increased error rate yesterday, but now everything it's back to normal. You can check out Prismic's status anytime in our status page.

Something still seems wrong with my repository. Old data is being loaded instead of the updated documents in Prismic. Is there a way to take a closer look at maybe specific issues on this repository?

For example - the top is query results from adding document.type and "news-item", the bottom result is from querying all documents. Document 4 on top set is old and doesn't exist anymore. It was archived and deleted. The bottom is correct.

To further add to the weirdness, the full query is also not returning updated fields. For instance, I have set the news type on this, and it comes back as null in the full query:

image

Just to move on, I ended up recreating the document type and re-entering the content. However, again, no subsequent publications are being recognized. The first publication posts fine, but updates are not picked up by the API, though they are saved somewhere because they appear in the prismic editor. The first publication date and last publication date are the same no matter how many times I publish:

image

When looking at the API browser directly, it has the latest content.

Hello again @asummers, this looks like an issue in the front-end of your site. Maybe you need to rebuild to be able to see the latest content. Are these documents published or in draft status?

They are all published. I was able to get around it by putting the call into the static props and passing it into the page. However, I would think this should also work as a call using the Client directly in a useEffect or similar. What front end issue would be causing the client api call to not return documents?

Are you by any chance using a particular ref in your queries? for example, a ref of a release.

Otherwise, there is no reason for the API to return out-of-date documents. Whenever you change your documents and publish, the master ref is automatically updated.

No, I am not specifying a ref. The code is just using the Client provided by prismicConfiguration file. Which, I agree - this is very weird behavior.

This may be happening because of static site generation. The data you generated at build time for 'pre-rendering' already exists. So, if you're in dev mode you should see the most up-to-date data, but in production, you'll only see the pre-rendered pages. You need to rebuild the site each time you update a document in your repository.