[
https://issues.apache.org/jira/browse/UNOMI-539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17465831#comment-17465831
]
Kevan Jahanshahi commented on UNOMI-539:
----------------------------------------
PR to review: https://github.com/apache/unomi/pull/370
> Sometimes SetEventOccurenceCountAction is counting the event twice
> ------------------------------------------------------------------
>
> Key: UNOMI-539
> URL: https://issues.apache.org/jira/browse/UNOMI-539
> Project: Apache Unomi
> Issue Type: Bug
> Affects Versions: 2.0.0, 1.6.0
> Reporter: Kevan Jahanshahi
> Priority: Major
> Fix For: 2.0.0, 1.6.0
>
>
> The SetEventOccurenceCountAction is used to increment the counter of the
> event for a given past event condition.
> But currently, in case the event is persisted, it have a chance to be counted
> twice due to the current algorithm:
> * step 1: query all existing event that match the condition to get current
> count from persisted events
> * step 2: increment the count +1 for current event received.
> in case the event is already stored and indexed at step 1, it will be counted
> in the count and it will be incremented again in step 2.
> This seem's wrong.
> Also the action is always returning PROFILE_UPDATED, witch is not true in
> some cases:
> * for example, in case the received event is out of the date constraints for
> the past event conditions, the count will not be incremented.
> Actually there is some integrations tests that are randomly failing due to
> this double increment issue:
> https://github.com/apache/unomi/runs/4609404924?check_suite_focus=true
--
This message was sent by Atlassian Jira
(v8.20.1#820001)