Skip to content

Add watching_session_end endpoint#528

Merged
mircealungu merged 1 commit intomasterfrom
add-watching-session-end
Apr 8, 2026
Merged

Add watching_session_end endpoint#528
mircealungu merged 1 commit intomasterfrom
add-watching-session-end

Conversation

@mircealungu
Copy link
Copy Markdown
Member

Companion to zeeguu/web#1023, which introduces a useWatchingSession hook that calls api.endWatchingSession on cleanup.

Summary

Adds a new /watching_session_end endpoint that mirrors watching_session_update. Today the body is functionally identical (UserWatchingSession has no is_active flag, unlike listening/reading/exercise/browsing), so this is a +15-line addition with no schema change.

The endpoint exists for symmetry with other session types and to give the frontend a clear "this is the final flush" semantic. We can grow side effects on it later (analytics, optional is_active if the model gains that column) without touching the frontend.

The streak credit still flows correctly via update_activity_session, which routes through the session-language attribution from #525.

Test plan

  • Module imports cleanly
  • Manual: open a video, watch for 3+ min, navigate away — confirm a final beacon hits /watching_session_end (200)
  • Manual: confirm watching streak still bumps after 2+ min of watching, with the correct language attribution

🤖 Generated with Claude Code

Mirrors watching_session_update but gives the frontend a clear "this
is the final flush" semantic that we can grow side effects on later
(e.g., flipping is_active if/when UserWatchingSession gains that flag,
emitting analytics events, etc.) without touching the frontend.

Today the body is identical to watching_session_update, because
UserWatchingSession has no is_active column. The streak credit still
flows correctly via update_activity_session, which routes through the
session-language attribution added in #525.

Companion to the frontend hooks refactor in zeeguu/web#1023, which
introduces a useWatchingSession hook that calls api.endWatchingSession
on cleanup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

ArchLens - No architecturally relevant changes to the existing views

@mircealungu mircealungu merged commit b0435d7 into master Apr 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant