Jerome Blanchard created UNOMI-927:
--------------------------------------

             Summary: Long Sessions can have a negative duration
                 Key: UNOMI-927
                 URL: https://issues.apache.org/jira/browse/UNOMI-927
             Project: Apache Unomi
          Issue Type: Bug
          Components: unomi(-core)
    Affects Versions: unomi-3.0.0
            Reporter: Jerome Blanchard


When a session duration exceed a certain amount of time (2 or 3 weeks) the 
duration can be negative !

Duration of a session is computed by the difference between 2 timestamp which 
are long values. 
Whereas, in the documentation and in ES mapping config, a Session's duration is 
supposed to be a long: 
[https://github.com/apache/unomi/blob/15ae3eaca8c640a00df255bb0da781fa55f19fa8/manual/src/main/asciidoc/datamodel.adoc#L503]

Also in the session mapping config for ESS and OS :

[https://github.com/apache/unomi/blob/15ae3eaca8c640a00df255bb0da781fa55f19fa8/persistence-elasticsearch/core/src/main/resources/META-INF/cxs/mappings/session.json#L21]

[https://github.com/apache/unomi/blob/15ae3eaca8c640a00df255bb0da781fa55f19fa8/persistence-opensearch/core/src/main/resources/META-INF/cxs/mappings/session.json#L21]

In Session.java,  there is a (int) cast when setting LastEventDate()
[https://github.com/apache/unomi/blob/15ae3eaca8c640a00df255bb0da781fa55f19fa8/api/src/main/java/org/apache/unomi/api/Session.java#L191]

It is also unclear why, in some translation (i18n) entries, it is mentioned 
some thresholds for session duration in seconds (even of those entries seems to 
not be used) : 
[https://github.com/apache/unomi/blob/15ae3eaca8c640a00df255bb0da781fa55f19fa8/plugins/baseplugin/src/main/resources/messages_en.properties#L80]

All duration in persistence are supposed to be milliseconds.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to