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

[NEXT-1185] revalidateTag is not working consistently #49368

Closed
1 task done
railaru opened this issue May 6, 2023 · 2 comments
Closed
1 task done

[NEXT-1185] revalidateTag is not working consistently #49368

railaru opened this issue May 6, 2023 · 2 comments
Labels
area: app App directory (appDir: true) bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team. locked Navigation Related to Next.js linking (e.g., <Link>) and navigation.

Comments

@railaru
Copy link

railaru commented May 6, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000
    Binaries:
      Node: 16.14.2
      npm: 9.3.0
      Yarn: N/A
      pnpm: 7.12.2
    Relevant packages:
      next: 13.4.1-canary.2
      eslint-config-next: 13.3.0
      react: 18.2.0
      react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

App directory (appDir: true), Routing (next/router, next/navigation, next/link)

Link to the code that reproduces this issue

https://github.com/railaru/nextjs-postgres-starter-prisma

To Reproduce

Background

This is a basic Next.js 13 Prisma template with server actions.

I've added the creation of new users and the editing and deleting of existing users.

Steps to reproduce:

  1. Run the project locally with Postgress ENV variables
  2. All the CRUD operations work when adding/removing/updating users in the same page
  3. When I go to users/:id and update a name or email there, it updates once
  4. When editing the same user twice, the old cache is still in place even though revalidateTag('users') is run and the username only changes after I refresh the page

Describe the Bug

Cache invalidation with revalidateTag and server actions is not working as expected. When doing CRUD actions on a different page, they don't work on other pages.

Expected Behavior

I would like to see the same behaviour as doing CRUD actions in the route or refreshing the page. In other words, the UI should be updated even if I updated the form on a different route, since I removed the cache.

Which browser are you using? (if relevant)

Chrome, Mac

How are you deploying your application? (if relevant)

Locally, Vercel

NEXT-1185

@railaru railaru added the bug Issue was opened via the bug report template. label May 6, 2023
@github-actions github-actions bot added area: app App directory (appDir: true) Navigation Related to Next.js linking (e.g., <Link>) and navigation. labels May 6, 2023
@timneutkens timneutkens added the linear: next Confirmed issue that is tracked by the Next.js team. label May 17, 2023
@timneutkens timneutkens changed the title revalidateTag is not working consistently [NEXT-1185] revalidateTag is not working consistently May 17, 2023
@shuding
Copy link
Member

shuding commented Jun 8, 2023

Looks like this was fixed by #50848, could you verify with latest canary? Thanks!

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: app App directory (appDir: true) bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team. locked Navigation Related to Next.js linking (e.g., <Link>) and navigation.
Projects
None yet
Development

No branches or pull requests

3 participants