Skip to content

[Contest] Apply track-comment shadowban filter to event comments#786

Merged
dylanjeffers merged 3 commits intomainfrom
contests-qa-event-shadowban
May 6, 2026
Merged

[Contest] Apply track-comment shadowban filter to event comments#786
dylanjeffers merged 3 commits intomainfrom
contests-qa-event-shadowban

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

Mirrors the karma / mute / abuse-score / deactivated-user CTE chain from v1_track_comments onto /v1/events/:eventId/comments. The track-comment endpoint already filtered:

  • comments authored by users muted by the viewer or by the track owner
  • comments authored by users muted by an aggregate of high-karma reporters (karma threshold)
  • comments reported by high-karma reporters (or by the viewer / track owner)
  • comments authored by users with a negative aggregate abuse score
  • comments authored by deactivated users

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_id in the mute/exemption clauses (the host's own comments and the viewer's own comments are always shown, matching the track behavior).

While here:

  • Adds a parent_comment_id roundtrip assertion to TestEventComments_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.
  • Adds TestEventComments_FiltersDeactivatedAuthor covering the deactivated-author path.

Commits

  • 7dbdbbe Apply track-comment shadowban filter to event comments

Test plan

  • go test ./api/ -run 'TestEventComments|TestTrackComments' passes locally
  • Existing event-comments behavior (sort, pagination, deleted-event 404, no track-comment leakage) preserved — covered by the existing test suite
  • Globally shadowbanned account's comments hidden on contest pages

🤖 Generated with Claude Code

dylanjeffers and others added 3 commits May 5, 2026 16:51
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>
@dylanjeffers dylanjeffers merged commit 6992edd into main May 6, 2026
5 checks passed
@dylanjeffers dylanjeffers deleted the contests-qa-event-shadowban branch May 6, 2026 04:09
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