Nothing replayed against upstream reads a session while it is playing #204
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
No scenario reads
/Sessionswhile anything is playing.playstate.jsonhas no/Sessionsrequest at all, andclients.json:78(/Sessions?activeWithinSeconds=900) runs with nothing playing. So the whole of what78be052eand1fe062f5changed — a playing session's position, and everything a reader sees between two reports — is covered by unit and route tests only, and by nothing the harness replays against upstream.1fe062f5added the ignore-list entry the scenario will need (**.PlayState.PositionTicks, value scope), because both servers now advance with the whole seconds of replay latency and the two disagree by however long the replay took to reach each of them. Without that entry the scenario flakes; with it, the position's shape is still diffed.What the scenario should cover
A report, then a read; a pause and a read; a resume; a seek; and a stop. The values the two servers agree on are the shape and everything around the position — what a reader must actually see is asserted in
crates/ephyra-http/tests/sessions.rsagainst a controlled clock, which is where it belongs.Two divergences to settle while doing it
LastActivityDatedoes not advance here. Upstream's automated tick runs throughUpdateNowPlayingItem, which sets it unconditionally (upstream/Emby.Server.Implementations/Session/SessionManager.cs:431), so a playing session's activity date keeps moving between reports. Measured 6s after one report: upstream13:49:12.5against a check-in of13:49:06.5; ours reads13:49:06.5for both. It feeds/Sessionsordering (:158) and theactiveWithinSecondsfilter (:2159) — a client reporting every 10s passesactiveWithinSeconds=5upstream and fails it here, which is a real behavioural difference and not only a date. The ignore list already suppresses the value withuntil: Never, so the harness will never show it; that is exactly how it hides.A session whose report carried an empty
ItemIddoes advance upstream.StartAutomaticProgressis armed regardless ofNowPlayingItem(:784); the timer's runtime is then null and the position advances unbounded. Our gate isnow_playing.is_some()(crates/ephyra-app/src/session/sessions.rs), so it freezes. No real client reports playback without an item, so this is probably the right call — but it is a divergence andDECISIONS.md:1150-1155says it gets written down either way.Found reviewing #201 (
1fe062f5). Related: #202, #203.Fixed in
198602a6,87975a4aand273dbdc9, landed onmainatf0ffda81.crates/ephyra-harness/scenarios/sessions.jsonreads/Sessionswhile a client plays: a report, pause, resume, seek and stop, each followed by a read. It was replayed against a private pair over copies ofsnapshots/default, because its reports write. The result was 13 responses, 13 in agreement and 19 values suppressed.Both divergences named here are settled:
LastActivityDatenow advances with the position, soactiveWithinSecondsagrees between reports.ItemIddoes not advance. This is recorded as D47 and held against the route in4d34b079.