Skip to content

[COOP-661] remove table constraint for NCMEC non-media submissions - #871

Merged
juanmrad merged 1 commit into
mainfrom
caleb/COOP-661-ncmec-text-only-migration
Aug 3, 2026
Merged

[COOP-661] remove table constraint for NCMEC non-media submissions#871
juanmrad merged 1 commit into
mainfrom
caleb/COOP-661-ncmec-text-only-migration

Conversation

@calebmcquaid

Copy link
Copy Markdown
Contributor

Context & Requests for Reviewers

PR 2 of X to fix #661

See #866. This PR needs to go out alongside #866. This is the migration change to change the DB constraint to allow non-media submissions to NCMEC.

Tests

Validated against the local DB by running the migration body inside a transaction and rolling it back

(Optional) Rollout Plan

This PR needs to be the first or second PR to go out alongside #866

Checklist

Only check items that apply to this PR; leave the rest unchecked.

  • If you changed anything user-facing (i.e. user interface or APIs):
    Did you update the CHANGELOG.md and related docs?

  • If you changed server/models/**/{ContentTypeModel,ActionModel,RuleModel,PolicyModel}.ts:
    Did you update the corresponding history tables and their triggers?

  • If you changed db/src/scripts/** and used CREATE TABLE, ADD COLUMN, or ALTER COLUMN:
    Are as many columns marked NOT NULL as possible? If some columns can sometimes be null depending on other columns, are there CHECK constraints capturing those relationships, and are these also reflected using unions in the associated Kysely types?

  • If you added a new signal in server/services/signalsService/signals/**:
    Did you classify every error case as a permanent error (SignalPermanentError, no retry) or a normal error (retryable)? Any case where the signal can't determine a score should be a SignalPermanentError.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@calebmcquaid, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fde828e1-64c8-427c-a7fc-4508a352e8c7

📥 Commits

Reviewing files that changed from the base of the PR and between dbc0682 and d4b5705.

📒 Files selected for processing (1)
  • db/src/scripts/api-server-pg/2026.06.30T03.50.47.allow_text_only_ncmec_reports.sql
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch caleb/COOP-661-ncmec-text-only-migration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@julietshen julietshen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good! The matching TypeScript type at server/services/ncmecService/dbTypes.ts:47-53 still says reported_media: NonEmptyArray<NcmecMediaReport>. That was accurate under the old setup but won't be once text-only reports can be saved.

maybe do a discriminated union so the check for non-empty messages is captured at the type level?

pls also update CHANGELOG.md 😁 thank you!

@calebmcquaid

Copy link
Copy Markdown
Contributor Author

@julietshen the DB type changes are made in #866. I don't think I went with a discriminated union but I can revisit that!

I will update the CHANGELOG.md ✅

@juanmrad
juanmrad merged commit 09cf03a into main Aug 3, 2026
18 checks passed
@juanmrad
juanmrad deleted the caleb/COOP-661-ncmec-text-only-migration branch August 3, 2026 23:49
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.

ENQUEUE_TO_NCMEC silently refuses text-only content, blocks enticement/grooming reports

4 participants