siftlode/backend/app
npeter83 a09e0dda0c 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
..
routes fix(player): persist watched at end-of-playback (atomic upsert) 2026-06-17 13:38:47 +02:00
static chore: rebrand Subfeed -> Siftlode 2026-06-14 04:40:22 +02:00
sync fix(sync): re-enrich live videos so ended streams gain duration 2026-06-16 10:06:58 +02:00
youtube feat(playlists): make YouTube-mirrored playlists editable + syncable 2026-06-15 21:40:13 +02:00
__init__.py feat: M1 foundation — compose stack, FastAPI, Google OAuth, encrypted tokens 2026-06-11 01:01:37 +02:00
auth.py fix(demo): graceful UX when YouTube actions are unavailable 2026-06-16 09:27:34 +02:00
config.py feat(playlists): YouTube playlist read-sync (backend) 2026-06-15 19:37:03 +02:00
db.py feat: M1 foundation — compose stack, FastAPI, Google OAuth, encrypted tokens 2026-06-11 01:01:37 +02:00
email.py chore: rebrand Subfeed -> Siftlode 2026-06-14 04:40:22 +02:00
main.py feat(scheduler): admin dashboard endpoint + per-job activity tracking 2026-06-16 14:38:51 +02:00
models.py feat(scheduler): admin-editable job intervals (DB-backed, live reschedule) 2026-06-16 15:58:23 +02:00
quota.py feat(stats): per-user API quota attribution + admin usage page 2026-06-12 02:47:55 +02:00
ratelimit.py feat(demo): demo-account schema + reusable rate limiter 2026-06-16 09:17:14 +02:00
scheduler.py feat(scheduler): admin-editable job intervals (DB-backed, live reschedule) 2026-06-16 15:58:23 +02:00
security.py feat: M1 foundation — compose stack, FastAPI, Google OAuth, encrypted tokens 2026-06-11 01:01:37 +02:00
state.py chore: structured timestamped logging across the backend 2026-06-11 04:26:18 +02:00