feat: add platform-wide activity feed (#1001)
* feat: add platform-wide activity feed (#971)
chronological feed of likes, track uploads, comments, and profile
joins. unlisted page at /activity — no nav link, accessible by URL.
reconstructed from existing DB tables via raw SQL UNION ALL query
with cursor-based pagination. includes 9 backend tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: add db_session to audio tests missing database setup
test_stream_audio_track_not_found and test_get_audio_url_not_found
were missing db_session fixture, causing "relation tracks does not
exist" under xdist when no prior test on the worker triggered table
creation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: handle docket worker teardown on stale event loop
under xdist, session-scoped TestClient teardown can run on a
different event loop than the one the docket worker task was created
on, causing RuntimeError. catch and log it during shutdown.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: skip docket worker in test lifespan to fix xdist teardown
the production lifespan starts a docket Worker that creates
asyncio.Task objects bound to the TestClient's portal event loop.
under xdist, session teardown runs on a different loop, causing
"attached to a different loop" in Worker.__aexit__.
no test needs a live docket worker (all docket usage is mocked),
so swap in a lightweight test lifespan that skips it entirely.
also reverts the _is_stale_loop_error hack in background.py.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* perf: add per-branch LIMIT and created_at indexes for activity feed
each UNION ALL branch now sorts+limits independently so postgres can
index-scan the top N per table instead of materializing all rows.
adds standalone created_at DESC indexes on artists, track_likes, and
track_comments to support the global feed query pattern.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
authored by
zzstoatzz.io