Repository navigation
fix(catalog): сброс кэша при изменении ACL групп ресурсов - #735
Merged
Merged
Conversation
…changes Manager ACL/membership mutations left cached ms3_products HTML and Web API facets serving closed products. Flush resource + ms3/facets once per request via plugin hooks and a dedicated invalidator when catalog RG filtering is on.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Описание
После #666/#681 каталог скрывает товары из закрытых групп ресурсов, но смена ACL не сбрасывала кэш страниц и фасетов. Закрытый товар мог оставаться виден анониму на закэшированном
ms3_productsи в Web API facets.Решение (вариант A): при мутациях ACL/членства групп ресурсов MiniShop3 один раз за запрос сбрасывает resource/page cache storefront-контекстов и партицию
ms3/facets. Решение зафиксировано в desc настройкиms3_web_catalog_respect_resource_groups(ru/en).Тип изменений
Связанные Issues
Closes #717
Как это было протестировано?
composer ci:php/composer test,npm run lint:ci,composer stan/ GitHub Actions CI)Конфигурация тестирования:
fix/issue-717-acl-cache-invalidate.phpstan-deps)Ручной сценарий: включить
ms3_web_catalog_respect_resource_groupsиaccess_resource_group_enabled. Закэшировать витрину сms3_products(без!). Закрыть товар через ACL группы ресурсов. Обновить страницу анонимом без Clear Cache. Товар не должен остаться в HTML. То же дляGET /api/v1/product/filters(фасеты).После установки/обновления пакета переподписать события плагина (новые:
OnResourceGroup*, membership,OnUserGroupRemove).Скриншоты (если применимо)
Чеклист
composer stan/ CI jobPHPStan)npm run lint:ciдля Vue)Дополнительные заметки
OnMODXInit(неOnHandleRequest:modConnectorRequestего не вызывает).OnUserGroupRemove.