siftlode/backend
npeter83 940b616804 fix(player): persist watched at end-of-playback (atomic upsert)
The in-app player marks a video watched when it reaches the end, firing
POST /videos/{id}/state at the same instant as a progress checkpoint. The
progress endpoint deletes the 'new' video_states row near the end, so the
concurrent state UPDATE matched 0 rows and raised StaleDataError -> 500. The
watched status was never persisted (and Feed swallowed the error), so the
video stayed in the unwatched feed even after a refresh.

- set_video_state: atomic INSERT ... ON CONFLICT (uq_user_video) DO UPDATE for
  watched/hidden, immune to a concurrent delete; tolerate StaleDataError on the
  'new' branch and in the progress endpoint.
- PlayerModal: skip the redundant near-end progress checkpoint when we just
  auto-marked watched, removing the self-inflicted race.
- Feed: drop the optimistic override if the server rejects the change, so a
  failed request can't leave a card phantom-hidden.
2026-06-17 13:38:47 +02:00
..
alembic feat(scheduler): admin-editable job intervals (DB-backed, live reschedule) 2026-06-16 15:58:23 +02:00
app fix(player): persist watched at end-of-playback (atomic upsert) 2026-06-17 13:38:47 +02:00
alembic.ini feat: M1 foundation — compose stack, FastAPI, Google OAuth, encrypted tokens 2026-06-11 01:01:37 +02:00
Dockerfile feat: M1 foundation — compose stack, FastAPI, Google OAuth, encrypted tokens 2026-06-11 01:01:37 +02:00
entrypoint.sh chore: rebrand Subfeed -> Siftlode 2026-06-14 04:40:22 +02:00
log_config.json chore: structured timestamped logging across the backend 2026-06-11 04:26:18 +02:00
requirements.txt fix(security): patch cryptography CVEs, upgrade pip at build, harden /auth/upgrade 2026-06-14 05:59:34 +02:00