Repository navigation
feat(api): weekly artist recap notification - #1070
Merged
Merged
Conversation
One weekly_artist_recap notification per artist on rollover Wednesday with plays, new followers, top city, saves, and saves from Weekly Rotation listeners for the week that just closed. Artists with no plays get nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 11, 2026
Merged
dylanjeffers
added a commit
to AudiusProject/apps
that referenced
this pull request
Nov 11, 2026
) ## Why Michael picked the weekly artist recap (2026-11-11). The api writes one `weekly_artist_recap` row per artist each Wednesday (AudiusProject/api#1070), and pedalboard pushes it (AudiusProject/pedalboard#111). Without this PR the adapter drops the row. ## What - `NotificationType.WeeklyArtistRecap` (also added to the push enum) and `WeeklyArtistRecapNotification {playCount, followerCount, saveCount, rotationSaveCount, topCity?, year, week}`. The adapter maps it in the pre-regen fallback branch, the same way `weekly_rotation_featured` is mapped, so no SDK regen is needed. - Copy lives in `weeklyArtistRecapNotificationMessages` and matches the push: - **Your Week on Audius** - `1,240 plays, 18 new followers, top city Atlanta, 42 saves`. Zero followers, zero saves and a missing city are left out. - When some saves came from Weekly Rotation listeners, the tile adds: `5 saves came from Weekly Rotation listeners.` - **Web tile** opens the Artist Dashboard. **Mobile tile** opens the artist's own profile. A **push tap** on mobile opens the Notifications tab, since the push has no entity. - **Flag:** `weekly_artist_recap`, on in development and off by default in production. Both tiles render nothing while it is off. ## Rollout - Add `weekly_artist_recap` in Optimizely and turn it on when we want the tile. - The push is gated separately by `push_weekly_artist_recap` in pedalboard. - The first rows land Wednesday 18:00 UTC after the api merges. While the flag is off, the server's unread count still includes the row, so an artist can see a badge with no visible tile. Flip the flag before that first Wednesday, or keep the api unmerged until then. ## Verification - New vitest `packages/common/src/adapters/notification.test.ts` covers the adapter mapping, a missing city, and the copy. It passes. - `tsc` for common, web and mobile shows no errors in touched files. The only errors are pre-existing ones from a stale local SDK build. - eslint passes on all touched files. - No device run: the tile can't be reached locally without a row from the api job. 🤖 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 picked the weekly artist recap from the new-notification list (2026-11-11). Each artist gets one note on Wednesday about the week that just closed, e.g. "Your week: 1,240 plays, 18 new followers, top city Atlanta, 42 saves."
What
WeeklyArtistRecapNotificationsJob(indexer, every 30s), modeled onWeeklyRotationFeaturedNotificationsJob(feat(api): tell artists how many Weekly Rotations featured their tracks #1069).{year, week, play_count, follower_count, save_count, rotation_save_count, top_city?}.play_count: rows inplaysfor the artist's tracks that week, excluding the artist's own plays.follower_count: follows created that week and still current.save_count: track saves created that week and still current.rotation_save_count: those saves where the saver's mix for that period had the track in the firstweeklyrotation.ShownSizeslots.top_city: most common non-emptyplays.city, ties by name. Left out when no play had a city.group_id = weekly_artist_recap:<YYYY-WW>:<artist_id>,specifier = artist_id,uq_notificationplusNOT EXISTS.playsis too big to scan on every tick, so each replica counts once per period (ix_plays_created_atrange scan), keeps the sorted rows in memory, and inserts 1000 per tick past anowner_idcursor.weekly_artist_recapis added to the notificationstypesfilter and to swagger.No migration.
Rollout
Merging this only writes rows. The push stays off until
push_weekly_artist_recapis added todiscovery_notification_mappingin Optimizely and set to true (pedalboard PRfeat/weekly-artist-recap). Clients that predate the apps PR drop the row in the adapter.The weekly count query has not been timed against prod data. Check the "Loaded weekly_artist_recap counts" log line (it includes the duration) on the first Wednesday.
Tests
go test ./jobs/ -run 'WeeklyArtistRecap|WeeklyRotationFeatured'andgo test ./api/ -run Notificationpass. Cases:🤖 Generated with Claude Code