fix(api): pick Weekly Rotation push recipients from plays - #1046
Merged
Merged
Conversation
challenge_listen_streak is only written by ListenStreakProcessor, which is a no-op while challenge `e` is inactive (it is in prod), so the table is stale and the weekly_rotation job was selecting almost no one. Use a recent play instead, via ix_plays_user_hour. Also trims the job's doc comment and drops the claim that the send window picks up listeners who become eligible after the cursor passes them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dylanjeffers
added a commit
that referenced
this pull request
Sep 24, 2026
This week's push used the stale `challenge_listen_streak` recipients. #1046 fixed that, but it merged at 19:00 UTC Thursday, after the 2026-39 window closed (Thu 16:00 UTC). - Extends the send window for period `2026-39` only, by 48h: sends now run until Sat 2026-09-26 16:00 UTC. Other periods keep the 24h window. - Idempotent as before: anyone already notified for 2026-39 is skipped via the group_id. - The override map can be removed after this weekend. Tests: `go test ./jobs/ -run TestWeeklyRotationNotifications` passes, including a new window-extension test. 🤖 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.
The weekly_rotation job chose recipients from
challenge_listen_streak.last_listen_date. The only writer of that table isListenStreakProcessor, which returns early unless challengeeis active, and prod reportseasactive: false(/v1/challenges/e/info). So the table is stale and the Wednesday fan-out was reaching almost nobody.EXISTSusesdate_trunc('hour', created_at)so it's a range scan onix_plays_user_hour.Not verified against prod data: I couldn't count stale rows (Metabase auth failed, kubectl needs a fresh gcloud login). Worth a quick
select count(*) from challenge_listen_streak where last_listen_date > now() - interval '30 days'vs. the Sep 16weekly_rotationnotification count.Tests:
go test ./jobs/ -run TestWeeklyRotationNotificationspasses.🤖 Generated with Claude Code