Skip to content

[bug] An item marked unplayed then played within one second stays unwatched #2193

Closed

Description

@Quick104

What happened

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

  1. Map a Jellyfin user to a Silo profile through Webhook Sync, with User Data Saved enabled.
  2. In Jellyfin, mark a watched item unplayed and then played again within one second (for example a quick double toggle).
  3. Check the item on the mapped Silo profile.

Expected behavior

The item is watched in Silo, matching Jellyfin.

Silo version / commit

main at the time of #2178.

Area

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.

Review thread: #2178 (comment)

Activity

  1. added
    bug
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions