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: 4208 - Empty title with special characters #4212

Merged

Conversation

louis-jan
Copy link
Contributor

@louis-jan louis-jan commented Dec 4, 2024

Describe Your Changes

  • This PR addressed an issue where thread title generation removed special characters that should also prevent multilingual support for that. Now it will remove only non-letter Unicode characters.

CleanShot 2024-12-04 at 11 41 10

CleanShot 2024-12-04 at 11 42 25@2x

Fixes Issues

Changes made

The code change in ModelHandler.tsx updates the cleanedMessageContent processing logic and adds validation. Specifically:

  1. The regular expression used in replace() is modified to:

    • Before: [^a-z0-9\s], which removes non-alphanumeric ASCII characters.
    • After: [^\p{L}\s]+, which removes non-letter Unicode characters using the Unicode property escapes.
  2. A new validation step is introduced:

    • It checks if cleanedMessageContent is empty after trimming. If it is, the function exits early to avoid processing or persisting an empty message.

@github-actions github-actions bot added the type: bug Something isn't working label Dec 4, 2024
@louis-jan louis-jan requested a review from a team December 4, 2024 04:41
Copy link
Contributor

github-actions bot commented Dec 4, 2024

Barecheck - Code coverage report

Total: 69.29%

Your code coverage diff: 0.00% ▴

✅ All code changes are covered

@louis-jan louis-jan merged commit 9c5a6e2 into dev Dec 4, 2024
11 checks passed
@louis-jan louis-jan deleted the fix/4208-should-not-filter-out-special-chars-on-title-update branch December 4, 2024 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants