Skip to content

Commit

Permalink
Merge pull request #1 from germanocaumo/fix-multiple-sessions-durations
Browse files Browse the repository at this point in the history
fix: wrong duration when user has multiple sessions with same internal id
  • Loading branch information
fcecagno authored Sep 23, 2024
2 parents 3121586 + 7ce9bd6 commit e06349b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
bbbevents (1.5.0)
bbbevents (1.5.1)
nokogiri

GEM
Expand Down
8 changes: 7 additions & 1 deletion lib/bbbevents/recording.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,13 @@ def fill_missing_left_events(combined_tuples)
unless joins_lefts_arr_sorted_length == i
# Take the next event as the left event for this current event
next_event = joins_lefts_arr_sorted[i + 1]
left_event = {:timestamp => next_event[:timestamp], :userid => cur_event[:userid], :event => :left}

# only match if it's the same userId
if cur_event[:join][:userid] == next_event[:join][:userid]
left_event = {:timestamp => next_event[:join][:timestamp], :userid => cur_event[:join][:userid] , :event => :left}
else
left_event = {:timestamp => @finish, :userid => cur_event[:join][:userid], :event => :left}
end

cur_event[:left] = left_event
end
Expand Down
2 changes: 1 addition & 1 deletion lib/bbbevents/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module BBBEvents
VERSION = "1.5.0"
VERSION = "1.5.1"
end

0 comments on commit e06349b

Please sign in to comment.