Skip to content

Fix nextjs Server Actions example#3061

Open
emcfarlane wants to merge 1 commit intoconnectrpc:mainfrom
emcfarlane:ed/fixServerActions
Open

Fix nextjs Server Actions example#3061
emcfarlane wants to merge 1 commit intoconnectrpc:mainfrom
emcfarlane:ed/fixServerActions

Conversation

@emcfarlane
Copy link
Copy Markdown

This fixes the nextjs "Server actions" example. This was caused by unstable_cache(fn, keyParts, options) which takes three arguments. The second (keyParts) is for cache key generation, while tags must be specified in the third argument (options). Without tags, revalidateTag("my-messages") in the server action was a no-op, so the cached getMessages result never invalidated and the UI always re-rendered with stale data.

Screenshot 2026-04-13 at 7 49 58 PM

Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants