Skip to content

fix(next): isolate autorun async context for revalidation#16412

Open
nehaaprasaad wants to merge 8 commits intopayloadcms:mainfrom
nehaaprasaad:feat/can-use-rev-job
Open

fix(next): isolate autorun async context for revalidation#16412
nehaaprasaad wants to merge 8 commits intopayloadcms:mainfrom
nehaaprasaad:feat/can-use-rev-job

Conversation

@nehaaprasaad
Copy link
Copy Markdown

@nehaaprasaad nehaaprasaad commented Apr 28, 2026

What?

  • Add async wrapper hook for Payload autorun jobs.
  • Use Next wrapper to clear render work-unit context.
  • Apply wrapped cron options in initReq, login, logout, and refresh.

Why?

  • Prevent revalidatePath / revalidateTag errors in queued job handlers.

How?

  • Wrap autorun tick execution via optional init hook.
  • Implement Next wrapper with workUnitAsyncStorage.run(undefined, ...).
  • Reuse shared cron payload options in Next entry points.

Fixes : #16392

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant