David Griffon created UNOMI-597:
-----------------------------------

             Summary: Clean up event target from non necessary objects
                 Key: UNOMI-597
                 URL: https://issues.apache.org/jira/browse/UNOMI-597
             Project: Apache Unomi
          Issue Type: Bug
            Reporter: David Griffon
             Fix For: 2.0.0


Story not needed for security, but would great to tackle as part of tech debt

While looking at the ES mapping on Jahia.com (DMF-4926), it appears that the 
profile has been added to some target events (almost all properties from the 
profile are currently mapped under /target/profile)

We need to investigate to find out what is adding that profile info then remove 
it if not useful.

Start event and end event are part of the target and should be removed as well

This is still happening on jahia.com as the profile mapping was part of the 
last monthly event index.
h3. Mappings that shouldnt be created after cleanup:
 - target/systemProperties/goals
 - target/profile
 - target/startEvent
 - target/endEvent

h3. Migration strategy

*Existing data*
No migration

*Existing mapping*
No migration
h2. Technical Details

Identified place in Unomi backend: ({*}this event are currently persited, they 
should not{*}) 

*IncrementInterestAction.java:*
{code:java}
final Event updatePropertiesEvent = new Event("updateProperties", null, 
profile, null, null, profile, new Date());
updatePropertiesEvent.setProperty("update", propertyToUpdate);

return eventService.send(updatePropertiesEvent);
{code}
*GoalsServiceImpl.java:*
{code:java}
Action action3 = new Action();
action3.setActionType(definitionsService.getActionType("sendEventAction"));
action3.setParameter("eventType", "goal");
action3.setParameter("eventTarget", goal);
action3.setParameter("eventProperties", new HashMap<String, Object>());
rule.setActions(Arrays.asList(action1,action2,action3));
{code}
-> in this one the sendEventAction should have a new property to specify it 
should not be persisted.

*MergeProfilesOnPropertyAction.java:*
{code:java}
if (currentSession != null) {
    currentSession.setProfile(profile);
    eventService.send(new Event("sessionReassigned", currentSession, profile, 
event.getSourceId(), event, currentSession, event.getTimeStamp()));
}
{code}
And probably others, this is not a full list, it's just the one I already 
identified, 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to