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] A completion in the same second as an earlier partial stop adds no completed history row #5366
bugSomething isn't workingpriority: P2Limited scope, workaround exists, or polishtriagedHigh-confidence review completed; does not mean fixed, validated, or accepted for release.
When an item is completed in the same whole second as an earlier partial stop for it, the item is marked played but no completed history row is added, so its play count is one short. Seen through webhook sync; the same code serves other progress writers.
Steps to reproduce
Send a stop event for an item at a partial position.
Within the same second, send a completion (played) event for the same item and profile.
Read the item's watched state and history.
Expected behavior
A completed play is recorded even if a partial one landed in the same second.
Actual behavior
The item is played, but history has only the partial row.
Cause
AddHistoryIfMissing (internal/userstore/pgstore/progress.go:1486) treats any history row in the same whole second as the same play (NOT EXISTS at line 1534) and ignores completed, so the earlier partial row blocks the completed one. Webhook sync reaches it through internal/webhooksync/service.go:461 → internal/watchstate/service.go:317 → :672. The same-second rule guards against the import double-count fixed in #3433.
Silo version / commit
2970 · a16a24720 (local sandbox). Found during agent runtime testing for validation task #1238.
Reproduced on origin/main at 0ad67a01e: through a Jellyfin webhook connection, a PlaybackStop at a partial position and then a TogglePlayed played mark half a second later left the movie played, with only one partial history row and no completed play.
Cause: AddHistoryIfMissing skips an imported watch when the item already has a play in the same second, and it didn't check completion, so the earlier partial row hid the completion. The SQLite store had the same check.
Fix in #5403: a partial play no longer hides a completion in its second, on both stores. A replayed import is still skipped. Checked on a local build of the fix: the same two webhooks now leave a partial row and a completed row, and sending them again adds nothing. A shared conformance test covers both stores, including replays and a partial stop after a completion.
AI disclosure: reproduced and fixed by Claude Code (claude-opus-5-5) at the maintainer's direction.
bugSomething isn't workingpriority: P2Limited scope, workaround exists, or polishtriagedHigh-confidence review completed; does not mean fixed, validated, or accepted for release.
Activity
Rhainland commentedon Nov 26, 2026
Reproduced on
origin/mainat0ad67a01e: through a Jellyfin webhook connection, aPlaybackStopat a partial position and then aTogglePlayedplayed mark half a second later left the movie played, with only one partial history row and no completed play.Cause:
AddHistoryIfMissingskips an imported watch when the item already has a play in the same second, and it didn't check completion, so the earlier partial row hid the completion. The SQLite store had the same check.Fix in #5403: a partial play no longer hides a completion in its second, on both stores. A replayed import is still skipped. Checked on a local build of the fix: the same two webhooks now leave a partial row and a completed row, and sending them again adds nothing. A shared conformance test covers both stores, including replays and a partial stop after a completion.
AI disclosure: reproduced and fixed by Claude Code (claude-opus-5-5) at the maintainer's direction.