You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by GitBox <gi...@apache.org> on 2022/09/02 14:33:31 UTC

[GitHub] [unomi] jsinovassin opened a new pull request, #488: UNOMI-660 : store correctly the ids of the events leading to the sess…

jsinovassin opened a new pull request, #488:
URL: https://github.com/apache/unomi/pull/488

   …ion creation
   
   https://issues.apache.org/jira/browse/UNOMI-660
   


-- 
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: dev-unsubscribe@unomi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [unomi] jsinovassin merged pull request #488: UNOMI-660 : store correctly the ids of the events leading to the sess…

Posted by GitBox <gi...@apache.org>.
jsinovassin merged PR #488:
URL: https://github.com/apache/unomi/pull/488


-- 
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: dev-unsubscribe@unomi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [unomi] jkevan commented on a diff in pull request #488: UNOMI-660 : store correctly the ids of the events leading to the sess…

Posted by GitBox <gi...@apache.org>.
jkevan commented on code in PR #488:
URL: https://github.com/apache/unomi/pull/488#discussion_r961778052


##########
rest/src/main/java/org/apache/unomi/rest/service/impl/RestServiceUtilsImpl.java:
##########
@@ -241,6 +238,11 @@ public EventsRequestContext performEventsRequest(List<Event> events, EventsReque
             // set Total items on context
             eventsRequestContext.setTotalItems(events.size());
 
+            boolean toStoreEventIdsInSession = false;
+            if (eventsRequestContext.getSession() != null
+                    && profileService.loadSession(eventsRequestContext.getSession().getItemId(), null) == null) {

Review Comment:
   I would be better to add an information in the EventsRequestContext object saying that the session is new, instead of adding here an extra call to the persistence to check if the session exists or not.



##########
rest/src/main/java/org/apache/unomi/rest/service/impl/RestServiceUtilsImpl.java:
##########
@@ -186,8 +185,6 @@ public EventsRequestContext initEventsRequest(String scope, String sessionId, St
                     // Only save session and send event if a session id was provided, otherwise keep transient session
 
                     Session session = new Session(sessionId, sessionProfile, timestamp, scope);
-                    session.setOriginEventTypes(events.stream().map(Event::getEventType).collect(Collectors.toList()));
-                    session.setOriginEventIds(events.stream().map(Item::getItemId).collect(Collectors.toList()));

Review Comment:
   Here: eventRequestContext.setSessionIsNew(true);



##########
rest/src/main/java/org/apache/unomi/rest/service/impl/RestServiceUtilsImpl.java:
##########
@@ -276,6 +278,10 @@ public EventsRequestContext performEventsRequest(List<Event> events, EventsReque
                     if ((eventsRequestContext.getChanges() & EventService.PROFILE_UPDATED) == EventService.PROFILE_UPDATED) {
                         eventsRequestContext.setProfile(eventToSend.getProfile());
                     }
+                    if(toStoreEventIdsInSession){

Review Comment:
   Here: if (eventsRequestContext.isSessionNew()) {...}



-- 
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: dev-unsubscribe@unomi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org