Skip to content

Add contest follower notifications#778

Merged
dylanjeffers merged 1 commit intomainfrom
contest-follower-notifications
Apr 23, 2026
Merged

Add contest follower notifications#778
dylanjeffers merged 1 commit intomainfrom
contest-follower-notifications

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

  • Adds fan_remix_contest_submission notification fanout in handle_track.sql — every contest follower (subscriber of the event) and the host get an in-app notification per new submission, except the submitter themselves
  • Adds remix_contest_update to the validator + swagger; the row is written from the discovery-provider indexer when the host posts a top-level comment on the event
  • Includes event subscribers in the existing fan_remix_contest_started UNION on both the event-create path (handle_event.sql) and the unlisted→public transition path (handle_track.sql)
  • Tightens end_date filter to also allow open-ended contests (end_date is null or end_date > now())
  • Pairs with apps-3 (indexer + frontend) and pedalboard (push mappers)

Test plan

  • Apply migration on staging, create a remix contest, have a second user submit — confirm fan_remix_contest_submission rows appear for the host and any subscribers
  • Have the host post a top-level comment on the event — confirm remix_contest_update rows appear for subscribers
  • Confirm /v1/notifications?types=fan_remix_contest_submission,remix_contest_update filter accepts the new types

🤖 Generated with Claude Code

Adds two notification types and expands the recipient set for existing
contest notifications so contest followers are first-class citizens.

- fan_remix_contest_submission: per-submission alert to contest followers
  and the host (excluding the submitter). Inserted from handle_track.sql.
- remix_contest_update: emitted from comment.py in discovery-provider when
  the contest host posts a top-level comment on the event.
- handle_event.sql + handle_track.sql unlisted->public: include event
  subscribers in the started fanout alongside host followers and savers.
- end_date null check tightened to (end_date is null or end_date > now()).

Swagger updated with the two new notification schemas.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dylanjeffers dylanjeffers merged commit 9f88dc4 into main Apr 23, 2026
5 checks passed
@dylanjeffers dylanjeffers deleted the contest-follower-notifications branch April 23, 2026 20:27
dylanjeffers added a commit to AudiusProject/apps that referenced this pull request Apr 23, 2026
## Summary
Adds in-app + push delivery for two new contest notification types and
expands the recipient set on existing contest notifications so contest
followers (event subscribers) and host followers are first-class
citizens.

**Indexer (discovery-provider):**
- `comment.py` writes `remix_contest_update` to event subscribers when
the contest host posts a top-level comment on their event.
- `track.py` auto-subscribes the submitter to the contest event on
`create_track` (skips if uploader is the host or already subscribed).
- `utils.py` includes contest subscribers in `fan_remix_contest_started`
recipients.
- `fan_remix_contest_ended.py`, `fan_remix_contest_ending_soon.py`,
`fan_remix_contest_winners_selected.py`: union in subscribers + host
followers + parent-track savers; explicitly exclude the host (they have
the artist_* counterparts).

**Frontend (web + mobile + common):**
- New `RemixContestUpdate` and `FanRemixContestSubmission` notification
types in `common`, with adapter parsing both camelCase and snake_case
keys (so this lands ahead of SDK regen).
- New web + mobile components, registered in `Notification.tsx` /
`NotificationListItem.tsx`.
- Mobile navigation: `RemixContestUpdate` → contest entity,
`FanRemixContestSubmission` → submitted remix track.

**Test:**
- Updated `test_event_comment.py` for the new `entity_id` /
`entity_user_id` data shape.

Pairs with:
- api: AudiusProject/api#778 (SQL trigger + validator + swagger)
- pedalboard: AudiusProject/pedalboard#11 (push processors)

## Test plan
- [ ] After all three land, create a contest, submit a remix from a
second account → submitter is auto-subscribed; host + any subscribers
see `fan_remix_contest_submission` in-app and push
- [ ] Host posts a top-level comment on the event → subscribers see
`remix_contest_update` in-app and push; host's own replies do NOT
trigger it
- [ ] Subscribe to a contest from a third account → see
`fan_remix_contest_started` (if unlisted→public happens after
subscribing), `_ending_soon`, `_ended`, and `_winners_selected` in
addition to remixers/host followers/savers
- [ ] Verify host does not receive the `fan_*` versions of ended /
ending_soon / winners_selected

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant