You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] An item marked unplayed then played within one second stays unwatched #2193
Found in code review of #2178; not reproduced on a deployment.
When an item is marked unplayed and then played again within the same UTC second, it can stay unwatched in Silo. The user stores keep the timestamps of these writes at different precisions:
RemoveHistoryItems sets the removal watermark (hidden_before) from the event time, to the microsecond.
SetProgressAt and imported history format their timestamps with time.RFC3339, in whole seconds.
A played write in the same second as an earlier removal gets a whole-second timestamp at or before the watermark. Progress and history at or before the watermark are hidden, so the played mark has no visible effect. Webhook sync still records the event as applied, so resending it does not fix the profile.
Emby has the same gap on main (item.markunplayed then item.markplayed). #2178 adds Jellyfin TogglePlayed marks, which hit it too.
Steps to reproduce
Map a Jellyfin user to a Silo profile through Webhook Sync, with User Data Saved enabled.
In Jellyfin, mark a watched item unplayed and then played again within one second (for example a quick double toggle).
User stores (Postgres and SQLite progress and history), reached through Webhook Sync and history import.
Technical notes
How often this happens in practice is unknown; it needs two opposite marks inside one second. Possible fixes:
Store and compare imported progress and history timestamps at sub-second precision, so a later write lands after the watermark. History import compares WatchProgress.UpdatedAt by exact RFC3339 string in dismissImportedResume, so that comparison has to change with it.
Give removal watermarks and imported writes one precision and a strict tiebreak.
Activity