[Contest] Apply track-comment shadowban filter to event comments#786
Merged
dylanjeffers merged 3 commits intomainfrom May 6, 2026
Merged
[Contest] Apply track-comment shadowban filter to event comments#786dylanjeffers merged 3 commits intomainfrom
dylanjeffers merged 3 commits intomainfrom
Conversation
Mirror v1_track_comments' karma/mute/abuse-score/deactivated-user CTE chain on /v1/events/:eventId/comments so a globally shadowbanned account can't re-emerge on contest pages. The event host takes the place of track.owner_id (they get the same "always show your own + host comments" exemptions). Adds a regression test covering the deactivated-author case and asserts that nested replies expose parent_comment_id, since the mobile/web row classifier routes replies to the Updates feed when that field is missing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The contest discovery page now sorts by:
1. Contests run by the featured-audience account
(config.Cfg.FeaturedAudienceUserID, set via the
featuredAudienceUserId env var; 0 disables prioritization).
2. Contests with at least one valid entry.
3. Ended contests with zero entries — sent to the bottom of the list
so the user always sees actionable contests first.
Within each group the existing active-first / soonest-ending sort still
applies. Entry counts are now produced by a LATERAL subquery in the main
list query and re-used for the related.entry_counts response, replacing
the separate aggregate query that ran afterwards.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop contests from the discovery endpoint when the parent track is deleted/unlisted or the host account is deactivated/unavailable. The frontend was masking these via a client-side filter in useAllRemixContests; backend is now the source of truth. Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
Mirrors the karma / mute / abuse-score / deactivated-user CTE chain from
v1_track_commentsonto/v1/events/:eventId/comments. The track-comment endpoint already filtered:Without this on the event endpoint, an account globally shadowbanned from track comments could re-emerge on contest pages — a fan or contest host could see comments the track surface had already filtered. The event host takes the place of
track.owner_idin the mute/exemption clauses (the host's own comments and the viewer's own comments are always shown, matching the track behavior).While here:
parent_comment_idroundtrip assertion toTestEventComments_ReturnsTopLevelOnlyNewestFirst— the mobile/web row classifier mis-routes artist replies to the Updates feed when the field is missing, so we want a regression guard.TestEventComments_FiltersDeactivatedAuthorcovering the deactivated-author path.Commits
7dbdbbeApply track-comment shadowban filter to event commentsTest plan
go test ./api/ -run 'TestEventComments|TestTrackComments'passes locally🤖 Generated with Claude Code