Bug description
Regroup play history can merge unrelated non-live items on long-lived databases where historical rating_key collisions exist.
What I observed
Observed on August 2, 2026 on a long-running Tautulli instance that has survived multiple Plex/library migrations over the years.
After resetting reference_id values to repair a visibly broken group, running Regroup play history recreated the incorrect merge.
Verified example from the database:
- row
2381: Modern Family - Wine Weekend
- row
9704: NCIS: Origins - Operazione Tramonto
- both rows stored with
rating_key = 8908
- the rows have different
guid values
- regroup merged them again because it grouped by
user_id + rating_key
Source analysis
In plexpy/activity_processor.py:
regroup_history() iterates all history rows and calls group_history()
- for non-live media,
group_history() selects the previous rows using user_id and rating_key
- it then reuses the previous row's
reference_id
- it does not validate that non-live rows also share the same
guid
That means a historical rating_key collision can recreate an invalid group even after reference_id is repaired.
Why I think this matters
This seems especially likely on old databases that span years of Plex migrations, metadata changes, or library rebuilds.
In my backup DB, I found:
- 475
rating_key values attached to multiple different titles
- 517
rating_key values attached to multiple different guid values
- 1909 rows involved in those multi-
guid collisions
Expected behavior
Regroup play history should not merge non-live rows unless they identify the same underlying item.
Suggested fix
Require matching guid for non-live regrouping before reusing a previous reference_id.
I also prepared a branch with a candidate fix:
vefilippo/Tautulli branch codex/fix-history-regroup-guid
Bug description
Regroup play historycan merge unrelated non-live items on long-lived databases where historicalrating_keycollisions exist.What I observed
Observed on August 2, 2026 on a long-running Tautulli instance that has survived multiple Plex/library migrations over the years.
After resetting
reference_idvalues to repair a visibly broken group, runningRegroup play historyrecreated the incorrect merge.Verified example from the database:
2381:Modern Family - Wine Weekend9704:NCIS: Origins - Operazione Tramontorating_key = 8908guidvaluesuser_id + rating_keySource analysis
In
plexpy/activity_processor.py:regroup_history()iterates all history rows and callsgroup_history()group_history()selects the previous rows usinguser_idandrating_keyreference_idguidThat means a historical
rating_keycollision can recreate an invalid group even afterreference_idis repaired.Why I think this matters
This seems especially likely on old databases that span years of Plex migrations, metadata changes, or library rebuilds.
In my backup DB, I found:
rating_keyvalues attached to multiple different titlesrating_keyvalues attached to multiple differentguidvaluesguidcollisionsExpected behavior
Regroup play historyshould not merge non-live rows unless they identify the same underlying item.Suggested fix
Require matching
guidfor non-live regrouping before reusing a previousreference_id.I also prepared a branch with a candidate fix:
vefilippo/Tautullibranchcodex/fix-history-regroup-guid