You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by "Kevan Jahanshahi (Jira)" <ji...@apache.org> on 2021/12/27 17:07:00 UTC

[jira] [Created] (UNOMI-539) Sometimes SetEventOccurenceCountAction is counting the event twice

Kevan Jahanshahi created UNOMI-539:
--------------------------------------

             Summary: 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
             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)