Skip to content

PM-6594: Watch challenge forums for registrants and copilots - #19

Merged
jmgasper merged 1 commit into
developfrom
PM-6594
Oct 16, 2026
Merged

jmgasper merged 1 commit into
developfrom
PM-6594

Conversation

@jmgasper

@jmgasper jmgasper commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What was broken

Registrants and copilots missed emails when a new challenge forum topic was created. Members also had no challenge-wide watch preference to control those notifications.

Root cause

Recipients came only from explicit topic/ancestor watches, and top-level challenge-topic creation skipped notification publishing entirely.

What was changed

  • Default challenge-wide watches to on for Submitter and Copilot resource assignments, without requiring a forum visit or registration-service changes.
  • Persist explicit preferences, including opt-outs, in ChallengeForumWatch; add authenticated current-member GET/PUT/DELETE /v6/forums/challenges/:challengeId/watch endpoints.
  • Include challenge watchers in new-topic/post notifications, preserving author exclusion, deduplication, visibility, bans, and independent topic watches.
  • Publish top-level challenge starter notifications after the content transaction commits.
  • Add the database migration, generated Prisma exports, and documentation.

Deploy migration 20261016000000_challenge_forum_watch, then this API, before platform-ui PR #2499.

Any added/updated tests

Added resource-role/default-watch, preference persistence/authorization, recipient filtering, post-commit publication, and HTTP opt-out/re-watch regressions.

Validation (after nvm use):

  • pnpm lint and pnpm build: passed.
  • pnpm test --runInBand with local moderation database checks: 181 passed; the separate public-forums database suite remains opt-in.
  • Full database-enabled suite: 188 passed, one existing public-import provenance failure. The same category-topic:99001 failure reproduces on unchanged origin/develop.
  • pnpm exec prisma migrate deploy: all five migrations passed on disposable PostgreSQL.
  • Real Prisma persistence checks: empty forum, repeated opt-out, re-watch, and unique preference row passed.

No dependencies were upgraded. Existing unrelated worktrees were left untouched.

What was broken
Registrants and copilots missed new challenge-topic emails and could not
manage a challenge-wide watch preference.

Root cause
Notifications resolved only explicit topic/ancestor watches. Top-level
challenge-topic creation also skipped the post-commit notification path.

What was changed
Resolve default challenge-wide watches from Submitter and Copilot resource
assignments. Persist explicit watch/unwatch choices in ChallengeForumWatch,
expose authenticated member preference endpoints, and include forum watchers
in new-topic/post notifications using the existing visibility and ban policy.
Publish top-level challenge starter notifications after commit. Add the
migration, regenerate the exported Prisma client, and document deployment.

Any added/updated tests
Add resource/default-watch and preference authorization tests, new-topic
recipient and post-commit tests, and HTTP opt-out/re-watch coverage.
Lint and build pass. The normal suite plus moderation database checks passes
181 tests. Running every PostgreSQL suite passes 188 tests and reproduces one
pre-existing public-import provenance failure on unchanged origin/develop.
All five migrations and empty-forum preference persistence pass locally.
@jmgasper
jmgasper merged commit bd5965b into develop Oct 16, 2026
2 checks passed
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