From 8241871bcf3dfa41286a1e6e2c206b914b981222 Mon Sep 17 00:00:00 2001 From: Maksim Hodasevich Date: Wed, 28 Oct 2026 16:00:31 +0100 Subject: [PATCH] fix(cms): revalidate every locale when a page or post is published, unpublished or deleted `_status` is not localized, but the page and post revalidation hooks only invalidated the locale from the request's ?locale= (default en). Deleting or unpublishing a document left its other locales served from the data cache, so /es/ kept returning 200 after the page was deleted. Status changes and deletes now invalidate all locales; content edits of a published document still invalidate only the edited locale. revalidatePageCache takes a list of locales. Scopes: apps/cms Page and Posts revalidation hooks, Header/Footer/GlobalBlock callers, lib/config/i18n, lib/utils/revalidatePageCache, tests/int. --- .../hooks/revalidateResourcesUsingFooter.ts | 2 +- .../hooks/revalidatePagesUsingGlobalBlock.ts | 2 +- .../hooks/revalidateResourcesUsingHeader.ts | 2 +- .../collections/Page/hooks/revalidatePage.ts | 11 ++-- .../collections/Posts/hooks/revalidatePost.ts | 19 +++--- apps/cms/src/lib/config/i18n.ts | 2 + apps/cms/src/lib/utils/revalidatePageCache.ts | 6 +- apps/cms/tests/int/revalidatePage.int.spec.ts | 58 +++++++++++++++++++ 8 files changed, 85 insertions(+), 17 deletions(-) create mode 100644 apps/cms/tests/int/revalidatePage.int.spec.ts diff --git a/apps/cms/src/collections/Footer/hooks/revalidateResourcesUsingFooter.ts b/apps/cms/src/collections/Footer/hooks/revalidateResourcesUsingFooter.ts index f4bbc0136..afc437bd5 100644 --- a/apps/cms/src/collections/Footer/hooks/revalidateResourcesUsingFooter.ts +++ b/apps/cms/src/collections/Footer/hooks/revalidateResourcesUsingFooter.ts @@ -44,7 +44,7 @@ export const revalidateResourcesUsingFooter: CollectionAfterChangeHook