Skip to content

Quirks with revalidation on new and unpublished posts #97

Open
@tddostu

Description

@tddostu

Hello, me again from #93. Thanks @stipsan for sorting that so quickly! I thought I'd make a new issue as this seems slightly different.

Unforuntately I've found a couple of other quirks with revalidation 😬

New posts:

When adding a new post, sometimes, some pages do not get revalidated. The webhook appears to send the right requests on all attempts, but some don't seem to update.

In the video below:

  • I publish 'New Post 3', the webhook sends the correct routes, but it does not update the actual site.
  • I then publish 'New Post 04', the webhook sends the correct routes again, but the site shows only the previous 'New Post 3' update (I promise I'm hitting refresh on the far right multiple times after an update, it's just out of the capture area 🙂).
  • Finally I publish 'New Post 05', the webhook sends the correct routes, all it all works as expected with all pages up to date.

A similar thing (not in the video) happens when I update an authors image. The revalidation routes sent are correct, but only some actaully update (some posts have the old author image, or even a different author if that was changed). The behaviour seems the same as the post issue, with only some pages actually get the new/updated content via on-demand ISR, despite all being requested to do so.

Sometimes however, it seems to all work. I can't quite figure out a pattern behind when it does.

Deleted/unpublished posts:

When deleting a post, everything seems to work fine, revalidation occurs and the post is removed. However if I instead unpublish it, it only requests revalidation for the homepage and the unpublished route, leaving the now unpublished post in the 'More stories' section of other posts.

Nextjs_Sanity-ISR_Issue02.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions