Hello I have read this article about Prismic Webhook and ISR
I implement in my project and I encounter some problem
my webhook will trigger when a document is published and when my endpoint receive the webhook, I will revalidate the specific page which will query the prismic data
the problem is, I will get the old content occasionally
-> update the document from A to B and published
-> prismic trigger webhook
-> revalidate the page and log the content I query
-> I got the content A (should be B)
-> update the document from B to C and published
-> prismic trigger webhook
-> revalidate the page and log the content I query
-> I got the content B (should be C)
and sometime I can get the correct latest content..
I also log the result I query and I found if I got the old content
the ref parameter will be same and last_publication_date is wrong
is it possible that prismic trigger webhook but the ref is not update yet ?
can tell more about the mechanism of ref populated ?
since the page will use the data from prismic, I just check the page content like some string
I also log the query result in getStaticProps and I confirm that I got the old content
I also log the result in api endpoint
// If you have a `createClient()` function defined elsewhere in
// your app, use that instead
const client = prismic.createClient('your-repo-name')
// Get a list of URLs for any new, updated, or deleted documents
const documents = await client.getAllByIDs(req.body.documents)
console.log('documents', documents). // >>> got the old content instead of latest content
so I am guessing there is a delay between the webhook and ref update mechanism (?)
Hello @client.mail.fe, are you using a catching system in your project?
The master ref is updated as soon as you make a new publication. If you get and query your documents with the most up-to-date ref you should be able to get the latest version of the content. You can double-check this in your repository's API browser. https://your-repo-name.prismic.io/api/v2