Skip to content

Conversation

mtrezza
Copy link
Member

@mtrezza mtrezza commented Oct 3, 2025

Pull Request

Issue

Parse Server doesn't support the unicode regex option.

Approach

Add regex option u for unicode support in Parse.Query.matches

Summary by CodeRabbit

  • New Features

    • Regex queries now support the 'u' (Unicode) option, enabling Unicode-aware pattern matching. Supported flags expand from i, m, x, s to i, m, x, s, u.
  • Bug Fixes

    • Validation of regex options improved to avoid rejecting queries that use the 'u' flag, preventing false errors for Unicode regex searches.

Copy link

parse-github-assistant bot commented Oct 3, 2025

🚀 Thanks for opening this pull request!

@parseplatformorg
Copy link
Contributor

parseplatformorg commented Oct 3, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

Copy link

coderabbitai bot commented Oct 3, 2025

📝 Walkthrough

Walkthrough

Allowed $regex $options in the query validator was broadened to include the Unicode 'u' flag (pattern changed from /^[imxs]+$/ to /^[imxsu]+$/). A test was added verifying regex matching with the 'u' flag against a Unicode (Chinese) string. No public/exported interfaces changed.

Changes

Cohort / File(s) Summary
Query regex options validation
src/Controllers/DatabaseController.js
Expanded allowed $regex $options pattern from /^[imxs]+$/ to /^[imxsu]+$/, permitting the 'u' flag and changing error behavior for previously rejected options.
Tests — regex unicode support
spec/ParseQuery.spec.js
Added a test case that saves an object with Chinese characters and asserts a regex query using the u (unicode) flag returns the expected result.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The description includes the standard Pull Request, Issue, and Approach headings but fails to link to a specific issue by providing a “Closes:” line and omits the required Tasks section with checkboxes for tests, documentation, security checks, and new error codes, so it does not adhere fully to the repository template. Add a “Closes: #ISSUE_NUMBER” under the Issue section and include a Tasks section listing the test additions, documentation updates, security check, and new error codes as appropriate with checkboxes to match the repository template.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title clearly and concisely summarizes the primary change by specifying the addition of the regex u option for Unicode support in Parse.Query.matches, accurately reflecting the code updates without extraneous detail.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f755a5d and 9d55d2e.

📒 Files selected for processing (1)
  • src/Controllers/DatabaseController.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: PostgreSQL 16, PostGIS 3.5
  • GitHub Check: PostgreSQL 17, PostGIS 3.5
  • GitHub Check: PostgreSQL 15, PostGIS 3.5
  • GitHub Check: PostgreSQL 15, PostGIS 3.3
  • GitHub Check: PostgreSQL 15, PostGIS 3.4
  • GitHub Check: Node 18
  • GitHub Check: Redis Cache
  • GitHub Check: Node 20
  • GitHub Check: MongoDB 6, ReplicaSet
  • GitHub Check: MongoDB 8, ReplicaSet
  • GitHub Check: MongoDB 7, ReplicaSet
  • GitHub Check: Docker Build

Copy link

codecov bot commented Oct 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.99%. Comparing base (89fad46) to head (9231194).
⚠️ Report is 3 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha    #9867      +/-   ##
==========================================
- Coverage   93.01%   92.99%   -0.02%     
==========================================
  Files         187      187              
  Lines       15097    15097              
  Branches      174      174              
==========================================
- Hits        14042    14040       -2     
- Misses       1043     1045       +2     
  Partials       12       12              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@mtrezza mtrezza changed the title feat: Add regex option u for unicode support in Parse.Query.matches feat: Add regex option u for unicode support in Parse.Query.matches for MongoDB Oct 3, 2025
@mtrezza mtrezza changed the title feat: Add regex option u for unicode support in Parse.Query.matches for MongoDB feat: Add regex option u for unicode support to Parse.Query.matches for MongoDB Oct 3, 2025
@mtrezza mtrezza changed the title feat: Add regex option u for unicode support to Parse.Query.matches for MongoDB feat: Add regex option u for unicode support in Parse.Query.matches for MongoDB Oct 3, 2025
@mtrezza mtrezza merged commit 7cb962a into parse-community:alpha Oct 3, 2025
23 of 25 checks passed
parseplatformorg pushed a commit that referenced this pull request Oct 3, 2025
# [8.3.0-alpha.2](8.3.0-alpha.1...8.3.0-alpha.2) (2025-10-03)

### Features

* Add regex option `u` for unicode support in `Parse.Query.matches` for MongoDB ([#9867](#9867)) ([7cb962a](7cb962a))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 8.3.0-alpha.2

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Oct 3, 2025
@mtrezza mtrezza deleted the feat/add-regex-options branch October 3, 2025 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released-alpha Released as alpha version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants