Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix revalidateTag() behaviour when invoked in server components (#70446) #70642

Merged
merged 4 commits into from
Sep 30, 2024

Commits on Sep 30, 2024

  1. Fix revalidateTag() behaviour when invoked in server components (ve…

    …rcel#70446)
    
    Fixes vercel#70403
    
    ### What?
    When `revalidateTag()` is called directly in server components, the
    cache is not purged for the corresponding tags. Reproduction steps
    available in vercel#70403
    
    ### How?
    Check
    [app-render.tsx](https://github.com/vercel/next.js/compare/canary...abhi12299:fix-revalidatetag-rsc?expand=1#diff-a3e2e024db1faa1b501e0dd6040eaaf0d931cb9878ae0fb0f4c3658daa982768)
    This issue was introduced in vercel#65296 in this file:
    [revalidate.ts](https://github.com/vercel/next.js/pull/65296/files#diff-7f0cb5bb30d44b9153d724e31c25859b9aab6cc258b35563a1d9464cd0688283).
    The lines removed from the file resulted in the revalidation checks to
    be skipped when there is an RSC request.
    
    Also fixed checks on `pendingRevalidates` to also check for
    `revalidatedTags`.
    
    ---------
    
    Co-authored-by: JJ Kasper <jj@jjsweb.site>
    # Conflicts:
    #	packages/next/src/server/app-render/app-render.tsx
    abhi12299 authored and ijjk committed Sep 30, 2024
    Configuration menu
    Copy the full SHA
    fec85a2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b07cc34 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c01346a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6047f26 View commit details
    Browse the repository at this point in the history