Repository navigation
feat(api): trending_genre notification for top 10 in a genre chart - #1071
Merged
Merged
Conversation
Every Friday, artists whose track is in the top 10 of its genre's weekly trending chart get "[track] is #4 in Dubstep this week". Only genres with at least 10 tracks on the chart count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 11, 2026
dylanjeffers
added a commit
to AudiusProject/apps
that referenced
this pull request
Nov 12, 2026
## Why Michael approved the genre chart notification (2026-11-11). Every Friday the api writes a `trending_genre` row for each track in the top 10 of its genre's weekly chart, for genres with at least 10 tracks on the chart (AudiusProject/api#1071). Pedalboard pushes it (AudiusProject/pedalboard#112). This renders it. ## What - **Adapter:** `trending_genre` maps to `NotificationType.TrendingGenre` `{rank, genre, entityType: Track, entityId}`. Handled in the pre-SDK-regen fallback like `weekly_artist_recap`. Rows with no genre or a bad id are dropped. - **Tiles:** web and mobile, "Charting in Dubstep" / "[track] is #4 in Dubstep this week!". Web has the X share button, mobile has the share card button. Both hidden while `trending_genre_notification` is off. - **Push:** `TrendingGenre` opens the track and, with `shareCard`, the stat card. - **Share card:** new `genre` stat kind, headline `#4` / `In Dubstep`, X text reuses the rank copy. - **Flag** `trending_genre_notification`: on in dev, off in prod. ## Rollout 1. Merge api#1071 so rows start on the next Friday 18:00 UTC. 2. Ship this (web gate + mobile OTA), then turn on `trending_genre_notification` in Optimizely. 3. Turn on `push_trending_genre` in `discovery_notification_mapping`. While the flag is off, artists get an unread badge with no visible tile, same as the recap. ## Tests `vitest src/adapters/notification.test.ts` passes (maps the row, drops a row with no genre). tsc on common, web and mobile shows nothing in the changed files; the remaining errors come from my local SDK build being older than main. Not checked in a running app yet. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
dylanjeffers
added a commit
that referenced
this pull request
Nov 12, 2026
…hem (#1073) Notifications stopped loading on web and mobile this afternoon. The generated SDK's `NotificationFromJSONTyped` throws on any type it doesn't know, so the whole response is rejected. Today's `weekly_rotation_featured` (#1069), `weekly_artist_recap` (#1070) and `trending_genre` (#1071) aren't in the SDK on any shipped client (or on apps main), and clients don't pass `types`, so any user with one of those rows got an empty list. These three types are now returned (and counted in `unread_count`) only when the caller includes them in `types`. Everything else is unchanged. The client still needs a follow-up: regenerate the SDK and request these types explicitly, and stop one unknown type from failing the whole page. Test: `TestV1Notifications_OptInTypesHiddenUnlessRequested` (fails without the fix). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Michael approved idea #5 from the new-notification list (2026-11-11): tell artists when they chart in their genre, e.g. "[track] is #4 in Dubstep this week". It reaches many more artists than overall trending. His rule: only genres with at least 10 tracks on the chart that week.
What
TrendingGenreNotificationsJob(indexer, every minute).track_trending_scores(what/tracks/trending?genre=serves), versionpnagD, genre-carrying rows only. Tracks that are deleted, unlisted or unavailable, or whose owner is deactivated, are dropped before ranking.trendingnotification that day are skipped so nobody gets two pushes for one track.group_id = trending_genre:<YYYY-MM-DD>:<track_id>,specifier = track_id.{track_id, genre, rank, week}.trendingwith a genre: older app builds rendertrendingas "Re-organize packages #4 on Trending", which would be wrong for a genre rank. It also doesn't depend on the trending reward challenge, which is being retired with $AUDIO rewards.trending_genreadded to the notificationstypesfilter and swagger.No migration.
Rollout
Merging only writes rows. The push stays off until
push_trending_genreis set in Optimizely (pedalboard PR), and the tile is behind thetrending_genre_notificationflag (apps PR). Clients without the apps PR drop the row in the adapter.Tests
go test ./jobs/ -run TrendingGenreandgo test ./api/ -run Notificationpass. Cases: ranks after dropping unlisted and deactivated tracks, the 10-track minimum (9-track genre gets nothing, exactly 10 qualifies), skipping tracks already notified for overall trending, ignoring month and genre-less rows, one snapshot per week even when scores move, the next Friday, send window edges and stage.🤖 Generated with Claude Code