feat(etl): port social triggers — handle_follow/save/repost (parity 1B)#239
Open
raymondjacobson wants to merge 1 commit intoetl/parity-1a-aggregate-tablesfrom
Open
feat(etl): port social triggers — handle_follow/save/repost (parity 1B)#239raymondjacobson wants to merge 1 commit intoetl/parity-1a-aggregate-tablesfrom
raymondjacobson wants to merge 1 commit intoetl/parity-1a-aggregate-tablesfrom
Conversation
Stack 1B of the trigger-port plan. Adds migration 0018 with:
- aggregate_user.score column (used by trigger shadowban check; default 0
means everyone passes, matching apps' bootstrap state before scores are
computed).
- handle_follow: maintains aggregate_user.{follower_count,following_count},
inserts milestone rows + follower-count and follow notifications.
- handle_save: maintains aggregate_track.save_count or
aggregate_playlist.save_count, aggregate_user.track_save_count, plus
milestone, save, save-of-repost, and remix-cosign notifications.
- handle_repost: maintains repost counts on aggregate_track /
aggregate_playlist / aggregate_user, plus milestone, repost,
repost-of-repost, and remix-cosign notifications.
The handle_save port stubs is_purchased / is_containing_album_purchased to
false. The original references usdc_purchases (Solana-side, intentionally
out of scope for go-openaudio) and playlist_tracks (Stack 2A); without
Solana indexing nothing is purchased so false is the correct value.
Six DB-backed tests verify trigger fire-and-effect for follow / save /
repost and unfollow decrement.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 7, 2026
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.
Summary
Stack 1B of the trigger-port plan. Migration 0018 adds:
Stubs
`handle_save` references two tables that don't exist in go-openaudio yet:
Both `is_purchased` and `is_containing_album_purchased` are stubbed to `false`. Without Solana indexing nothing is purchased, so this is the correct value for the current environment. When Stack 2A lands, the `playlist_tracks` JOIN can be re-introduced (it only matters once `usdc_purchases` exists, which is a separate Solana effort).
Stack context
Stacked on #238 (1A — aggregate tables).
Test plan
Six DB-backed tests in social_triggers_test.go:
🤖 Generated with Claude Code