Skip to content

feat: automated profanity filter for event content (#571) - #770

Open
saurabhhhcodes wants to merge 1 commit into
roshankumar0036singh:mainfrom
saurabhhhcodes:fix/571-profanity-filter
Open

feat: automated profanity filter for event content (#571)#770
saurabhhhcodes wants to merge 1 commit into
roshankumar0036singh:mainfrom
saurabhhhcodes:fix/571-profanity-filter

Conversation

@saurabhhhcodes

Copy link
Copy Markdown
Contributor

Closes #571

Problem

Event titles, descriptions, and venues are written to Firestore with no content moderation, so offensive language reaches all students/public pages immediately.

Changes

  • app/src/lib/profanity.js (new, zero dependencies):
    • case-insensitive matching
    • leet-digit mapping (1→i, 3→e, 4→a, 5→s, 7→t, 0→o, …)
    • separator-dodging (f.u.c.k, F U C K, f\*\*\*k)
    • token-boundary aware → classic, grass, cucumber are safe
    • exports PROFANITY_WORD_LIST (configurable), findProfanity, containsProfanity, maskProfanity
  • app/src/screens/CreateEvent.js: publishing is blocked (clear alert naming the word) when title, description, or venue contain a blocked word — before any write, including offline queueing.
  • app/src/lib/__tests__/profanity.test.js: 11 tests — plain/leet/padded variants detected, innocent substrings not flagged, masking length-preserving.

…ngh#571)

Event titles, descriptions and venues were written to Firestore with no
content moderation, letting offensive words reach all students.

- lib/profanity.js: dependency-free filter — leet-digit mapping
  (1->i, 4->a, 5->s, ...), case-insensitive, separator-dodging
  ('f.u.c.k', 'F U C K', 'f***k'), boundary-aware so harmless words
  containing blocklist substrings are NOT flagged; exports
  PROFANITY_WORD_LIST, findProfanity, containsProfanity, maskProfanity
- CreateEvent.js: blocked word in title/description/location blocks
  publish with a clear alert before any write
- 11 unit tests: plain/leet/padded variants, safe words, masking
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

Next review available in: 58 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eb6e42a4-db5a-4f9e-90d8-834989315b4c

📥 Commits

Reviewing files that changed from the base of the PR and between 5e6135e and 2e34515.

📒 Files selected for processing (3)
  • app/src/lib/__tests__/profanity.test.js
  • app/src/lib/profanity.js
  • app/src/screens/CreateEvent.js

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.

@sonarqubecloud

Copy link
Copy Markdown

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.

Automated Profanity Filter

1 participant