Skip to content

Conversation

@abhinavkrin
Copy link
Member

@abhinavkrin abhinavkrin commented May 7, 2025

Proposed changes (including videos or screenshots)

Fixes an issue where searching messages by attachment description or title failed when they contained non-ASCII characters. The problem was caused by the use of \w+ in the regex, which only matches ASCII characters. The regex has been updated to support Unicode characters, thereby enabling search functionality across multiple languages.

🧠 How updated search works

  • file-desc: and file-title: can be followed by:
    • A quoted string: file-desc:"multi word text"
    • An unquoted token: file-title:Summary
  • Fully supports:
    • Unicode (e.g., Cyrillic, Chinese)
    • Emojis
    • Mixed-language content
  • Remaining non-prefixed text is parsed into $text: { $search: "..." }

🧪 Examples

Search Input What It Does
file-desc:отчет Matches attachments whose description includes "отчет"
file-title:"project plan" Matches attachments titled "project plan"
file-desc:"budget 💰" file-title:report summary Matches messages with description "budget 💰", title "report", and message content matching "summary"
Screenshot 2025-05-08 at 2 31 17 AM

Issue(s)

Steps to test or reproduce

  1. Upload a file with a Cyrillic description in a message.
  2. Use file-desc: followed by Cyrillic characters in the search.
  3. Observe that the message now correctly appears in search results.

Further comments

SUP-768


This pull request addresses an issue in the Rocket.Chat repository where message searches fail when file descriptions or titles contain non-ASCII characters. The changes include enhancements to the message search query parser, specifically improving the regex patterns for label, file description, and file title filters. These improvements support both quoted and unquoted values and enhance tag handling, thereby enabling multi-language support. The changes are documented in the .changeset/popular-cameras-guess.md file and implemented in the apps/meteor/server/lib/parseMessageSearchQuery.ts file. The source branch for this fix is fix/search-file-desc-non-ascii, and it targets the develop branch.

@abhinavkrin abhinavkrin requested a review from a team as a code owner May 7, 2025 21:04
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented May 7, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented May 7, 2025

🦋 Changeset detected

Latest commit: b21a5d1

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

This PR includes changesets to release 36 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/mock-providers 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

@kody-ai
Copy link

kody-ai bot commented May 7, 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
Breaking Changes

Access your configuration settings here.

@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2025

PR Preview Action v1.6.1

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

Built to branch gh-pages at 2025-05-15 11:21 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Signed-off-by: Abhinav Kumar <[email protected]>
@kody-ai
Copy link

kody-ai bot commented May 7, 2025

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

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
Breaking Changes

Access your configuration settings here.

@codecov
Copy link

codecov bot commented May 7, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 6 lines in your changes missing coverage. Please review.

Project coverage is 64.72%. Comparing base (005ed34) to head (b21a5d1).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #35946   +/-   ##
========================================
  Coverage    64.72%   64.72%           
========================================
  Files         3248     3248           
  Lines        95462    95468    +6     
  Branches     17904    17880   -24     
========================================
+ Hits         61786    61794    +8     
+ Misses       30775    30766    -9     
- Partials      2901     2908    +7     
Flag Coverage Δ
e2e 58.42% <ø> (+<0.01%) ⬆️
unit 71.90% <33.33%> (+<0.01%) ⬆️

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.

@scuciatto scuciatto added stat: QA assured Means it has been tested and approved by a company insider and removed stat: QA assured Means it has been tested and approved by a company insider labels May 14, 2025
@scuciatto scuciatto added this to the 7.7.0 milestone May 14, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label May 14, 2025
@kodiakhq kodiakhq bot merged commit 0b4ed85 into develop May 15, 2025
48 checks passed
@kodiakhq kodiakhq bot deleted the fix/search-file-desc-non-ascii branch May 15, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants