Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Filtering non ascii bad words #35418

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

yash-rajpal
Copy link
Member

@yash-rajpal yash-rajpal commented Mar 6, 2025

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

SUP-704


This pull request aims to enhance the content moderation capabilities of the Rocket.Chat application by improving the bad words filtering system. It introduces support for filtering non-ASCII bad words, allowing for better moderation of messages in languages other than English. The changes include the addition of regex-based pattern matching to the existing bad words filter, which improves word boundary detection and ensures more consistent censorship of inappropriate language. These updates are implemented in the BeforeSaveBadWords.ts file and documented in the .changeset/witty-ads-visit.md file. The source branch for these changes is fix/non-ascii-bad-words, and the target branch is develop.

Copy link
Contributor

dionisio-bot bot commented Mar 6, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Mar 6, 2025

🦋 Changeset detected

Latest commit: 41d1cf8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

codecov bot commented Mar 6, 2025

Codecov Report

Attention: Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Project coverage is 59.43%. Comparing base (5457e94) to head (41d1cf8).
Report is 32 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #35418      +/-   ##
===========================================
- Coverage    59.44%   59.43%   -0.01%     
===========================================
  Files         2829     2829              
  Lines        68324    68345      +21     
  Branches     15130    15134       +4     
===========================================
+ Hits         40612    40620       +8     
- Misses       25054    25067      +13     
  Partials      2658     2658              
Flag Coverage Δ
unit 75.50% <88.88%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yash-rajpal
Copy link
Member Author

@kody start-review

Copy link

kodus-ai bot commented Mar 6, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization

Access your configuration settings here.

@yash-rajpal yash-rajpal marked this pull request as ready for review March 6, 2025 20:44
@yash-rajpal yash-rajpal requested a review from a team as a code owner March 6, 2025 20:44
@yash-rajpal yash-rajpal added this to the 7.5.0 milestone Mar 6, 2025
Copy link
Contributor

github-actions bot commented Mar 7, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-35418/

Built to branch gh-pages at 2025-03-07 16:30 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@yash-rajpal yash-rajpal requested a review from ricardogarim March 7, 2025 16:32
Comment on lines +32 to +33
} catch (error) {
this.badWordsRegex = null;
Copy link
Member

Choose a reason for hiding this comment

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

silently consuming the error. can we log this pls?

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.

3 participants