Fix mismatch between session and event user_ids after salts are rotated (#5065)
* Refactor test suite to allow seeking multiple sessions * Fix mismatch between session and event user_ids after salts are rotated Consider the following scenario 1. We receive a pageview from a user A 2. Salts are rotated after day end 3. We receive another pageview Previously, this would result in: - 2 different sessions with mismatching user_ids - 2 events where each would have different user_ids This fixes the problem by removing the previous faulty session updating and forcing the event.user_id to be updated after we found a session with the previous salt. * Remove an assertion
This commit is contained in:
parent
a7ff6faf00
commit
40926686f8
|
|
@ -29,6 +29,7 @@ All notable changes to this project will be documented in this file.
|
||||||
- Fix Direct / None details modal not opening
|
- Fix Direct / None details modal not opening
|
||||||
- Fix year over year comparisons being offset by a day for leap years
|
- Fix year over year comparisons being offset by a day for leap years
|
||||||
- Breakdown modals now display correct comparison values instead of 0 after pagination
|
- Breakdown modals now display correct comparison values instead of 0 after pagination
|
||||||
|
- Fix database mismatch between event and session user_ids after rotating salts
|
||||||
|
|
||||||
## v2.1.5-rc.1 - 2025-01-17
|
## v2.1.5-rc.1 - 2025-01-17
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ defmodule Plausible.ClickhouseEventV2 do
|
||||||
|
|
||||||
@session_properties [
|
@session_properties [
|
||||||
:session_id,
|
:session_id,
|
||||||
|
:user_id,
|
||||||
:referrer,
|
:referrer,
|
||||||
:referrer_source,
|
:referrer_source,
|
||||||
:click_id_param,
|
:click_id_param,
|
||||||
|
|
|
||||||
|
|
@ -78,8 +78,7 @@ defmodule Plausible.Session.CacheStore do
|
||||||
defp update_session(session, event) do
|
defp update_session(session, event) do
|
||||||
%{
|
%{
|
||||||
session
|
session
|
||||||
| user_id: event.user_id,
|
| timestamp: event.timestamp,
|
||||||
timestamp: event.timestamp,
|
|
||||||
entry_page:
|
entry_page:
|
||||||
if(session.entry_page == "" and event.name == "pageview",
|
if(session.entry_page == "" and event.name == "pageview",
|
||||||
do: event.pathname,
|
do: event.pathname,
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue