jkevan opened a new pull request #329:
URL: https://github.com/apache/unomi/pull/329


   … and previousVisit properties
   
   I would like to propose this new Implem for the handling of the lastVisit, 
firstVisit and previousVisit properties on the profile.
   
   The precedent implem was not logical and error prone.
   previous algorithm:
   
   profile:
   - firstVisit: 11/05/2021
   - previousVisit: 13/05/2021
   - lastVisit: 16/05/2021
   In case Event comes with a timeStamp: 10/05/2021, but the event is submitted 
to the system at 20/05/2021.
   Then the result was:
   - firstVisit: 11/05/2021
   - previousVisit: 16/05/2021
   - lastVisit: 20/05/2021
   
   This seem's not logical because the eventTimestamp is only source of truth 
regarding the chronology of the events and the visits. So we should not use the 
current date that the event is processed into the system.
   So I propose this result instead:
   - firstVisit: 10/05/2021
   - previousVisit: 13/05/2021
   - lastVisit: 16/05/2021
   
   My implem is updating the 3 dates to respect the chronology of the events 
received (previous implem was only updating lastVisit with no sense values).
   So depending on the event timeStamp, one of multiples of this 3 props will 
be updated accordingly to the eventTimeStamp.
   The profile will hold this informations updated.
   
   It have multiple benefits:
   - more logic and easy to understand (only one source of truth for the 
chronology of events)
   - better handling of events coming from the past (using pasted dates will be 
more easy to handle by the system)
   - segmentation will work better for segment with condition on this 3 props.
   
   Also this PR contains a simple improvement already asked for: 
https://issues.apache.org/jira/browse/UNOMI-482
   To be able to set the currentDate in the SetPropertyAction.
   SetPropertyAction with setPropertyValue: 'now' is now deprecated, I propose 
to use 'setPropertyValueCurrentEventTimestamp' or 'setPropertyValueCurrentDate' 
instead of 'setPropertyValue' that is more suitable for this need.
   
   Also this PR contains the integration tests necessary to tests all this 
changes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to