[MGNLADVCACHE-99] Personalization cache on inherited personalized components not working Created: 30/May/18  Updated: 02/Mar/23

Status: Open
Project: Advanced Cache
Component/s: personalization
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Michael Kemser Assignee: Unassigned
Resolution: Unresolved Votes: 4
Labels: cache, maintenance, personalization
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Debian (hosted), OS X (local development)


Attachments: PNG File image-2018-05-30-10-31-48-399.png     PNG File image-2018-05-30-10-33-27-698.png     PNG File image-2018-05-30-10-36-13-820.png    
Issue Links:
Cloners
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Visible to:
Olaf Kozlowski, zzzzJens Kolb (Lemonize) (Inactive)
Epic Link: Support
Team: DeveloperX

 Description   

Hello Magnolia Team,

we've run into another issue regarding personalization and caching.
(Last year i already opened a ticket under https://jira.magnolia-cms.com/browse/MGNLADVCACHE-94 with a similar problem).

Short description:
In PersonalizedCacheStore#isPersonalized (or as well in PersonalizedCachePolicy#shouldCache) there's a visitor running to check the requested page node for any personalized components. The problem: The visited node is not wrapped with an InheritanceNodeWrapper, so any personalized components inherited from a parent page aren't visited which will of course break the cache since magnolia will treat this page as a normal page and not a personalized page (In this case, if a personalized page was cached first, all users after that will get the same personalized page displayed even if they don't match the traits).

 

I'll also provide an example:

On the project we currently have an "Overlay" Area inheriting components to all subpages. In this area we have a personalized component which should be displayed under certain conditions.

Hope this is somehow understandable
(right now it's not a time critical issue since we are still in the "experimental" phase)

Visiting the root page it's fine:

(Breakpoint in PersonalizedCacheStore#isPersonalized)

The component itself (correctly wraped with the variant):

Visiting a subpage:

(The personalized component is correctly displayed on the subpage)

This will lead to the method returning false and thus wrongly caching the page as a normal page.
I could also reproduce this on the current demo instance.

 

I already thought about possible solutions:
The most reasonable solution I came up with would be by modifying the visitor to wrap the visited nodes before visiting them by using DefaultInheritanceContentDecorator#wrapNode.
Maybe there are easier solutions to that issue or I'm missing here something 

Thank you in advance for investigating the issue!

 

On behalf of AllSecur

Olaf Kozlowski
Lemonize GmbH


Generated at Sun Feb 11 23:11:00 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.