test(player): hold the session stop and the kept-point rule to the server

- The client's resume thresholds equal the server's (read from both sources).
- The session stop's URL matches the route the server serves it on.
- The player stops its server session by its item and its own id on an unload and on close,
  and keeps it when the page only goes into the back/forward cache.
This commit is contained in:
2026-10-07 23:16:38 +02:00
parent 392099770a
commit dd6a666ad1
5 changed files with 108 additions and 5 deletions
+2 -2
View File
@@ -6,8 +6,8 @@
// Where the point is kept is the caller's: the library's on the server (`library_states`), a shared
// link's in this browser (the viewer has no account). The rule for which point is worth keeping is
// the server's own (`routes/_common.kept_position`), repeated here for the link that has no server
// side: too early to count as started, or close enough to the end to count as finished, is "from
// the start".
// side (`resume.contract.test.ts` holds the two numbers equal): too early to count as started, or
// close enough to the end to count as finished, is "from the start".
import { useEffect, useEffectEvent } from "react";
import { LS, readJSON, writeJSON } from "./storage";