Commit f3f211a
chore: remove /v1/users/{id}/feed/for-you endpoint (#807)
## Summary
Retiring the dedicated For You feed endpoint. The clients are being
switched to use \`/v1/users/{id}/recommended-tracks\` instead — the same
endpoint that already powers the Explore page's For You section and
works fine in production. See companion PR: AudiusProject/apps#14301.
## Why
The custom \`/feed/for-you\` endpoint had repeated issues since it
shipped:
* **Auth gate bug** (fixed in #804) — global authMiddleware rejected
unsigned \`user_id\` requests, making the endpoint unreachable from the
web RC.
* **Perf** — even after #805 and #806 capped the \`my_saved_artists\`,
\`my_artist_affinity\`, and \`follow_set\` CTEs, EXPLAIN on prod showed
the \`similar_artists\` self-join still produced a 301M-row merge for
power users (and a fixed ~12s \`track_trending_scores\` scan for *every*
user due to a missing partial index). The endpoint never reliably
completed within Cloudflare's 100s upstream limit for power users.
* **Duplication** — the response shape (ranked track list for the
signed-in user) is already what \`/recommended-tracks\` returns. Two
endpoints solving the same problem isn't worth maintaining.
Consolidating on the working endpoint is simpler than continuing to
optimize the custom one.
## Removed
| File | What |
|---|---|
| \`api/v1_users_feed_for_you.go\` | Handler + the 200-row
candidate-pool SQL (4 candidate sources, similar_artists CF, diversity
pass) |
| \`api/v1_users_feed_for_you_test.go\` | 9 unit tests |
| \`api/server.go\` (1 line) | Route registration |
| \`api/auth_middleware.go\` (~10 lines) | The \`/feed/for-you\`
exemption from #804 — no longer needed |
| \`api/swagger/swagger-v1.yaml\` (~70 lines) | The endpoint's swagger
entry |
## Test plan
- ✅ \`go build ./api/...\` clean
- ✅ \`go vet ./api/...\` clean
- ✅ All remaining \`TestV1UsersFeed*\` / \`TestAuth*\` tests pass
locally
- After merge + deploy + AudiusProject/apps#14301 deploy: Feed → For You
tab on the web RC should show the same recommended tracks as Explore's
For You section.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 276fdeb commit f3f211a
5 files changed
Lines changed: 2 additions & 950 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
| 350 | + | |
| 351 | + | |
360 | 352 | | |
361 | 353 | | |
362 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
456 | | - | |
457 | 456 | | |
458 | 457 | | |
459 | 458 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9433 | 9433 | | |
9434 | 9434 | | |
9435 | 9435 | | |
9436 | | - | |
9437 | | - | |
9438 | | - | |
9439 | | - | |
9440 | | - | |
9441 | | - | |
9442 | | - | |
9443 | | - | |
9444 | | - | |
9445 | | - | |
9446 | | - | |
9447 | | - | |
9448 | | - | |
9449 | | - | |
9450 | | - | |
9451 | | - | |
9452 | | - | |
9453 | | - | |
9454 | | - | |
9455 | | - | |
9456 | | - | |
9457 | | - | |
9458 | | - | |
9459 | | - | |
9460 | | - | |
9461 | | - | |
9462 | | - | |
9463 | | - | |
9464 | | - | |
9465 | | - | |
9466 | | - | |
9467 | | - | |
9468 | | - | |
9469 | | - | |
9470 | | - | |
9471 | | - | |
9472 | | - | |
9473 | | - | |
9474 | | - | |
9475 | | - | |
9476 | | - | |
9477 | | - | |
9478 | | - | |
9479 | | - | |
9480 | | - | |
9481 | | - | |
9482 | | - | |
9483 | | - | |
9484 | | - | |
9485 | | - | |
9486 | | - | |
9487 | | - | |
9488 | | - | |
9489 | | - | |
9490 | | - | |
9491 | | - | |
9492 | | - | |
9493 | | - | |
9494 | | - | |
9495 | | - | |
9496 | | - | |
9497 | | - | |
9498 | | - | |
9499 | | - | |
9500 | | - | |
9501 | | - | |
9502 | | - | |
9503 | | - | |
9504 | | - | |
9505 | | - | |
9506 | 9436 | | |
9507 | 9437 | | |
9508 | 9438 | | |
| |||
0 commit comments