Message search is case-sensitive for non-ASCII letters (e.g. "über" does not find "Über", "привет" does not find "Привет")
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 52/100
Piste de recherche
Start with connectDB in Simplex.Messaging.Agent.Store.SQLite to see how SQLite connections register functions, then inspect searchCond in src/Simplex/Chat/Store/Messages.hs and the three getAllChatItems queries. Check the pinned direct-sqlcipher API and existing search tests; done means SQLite message and chat list searches find case-folded non-ASCII text while PostgreSQL behavior remains unchanged, with scan cost measured on a large database.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
Searching messages, in a single chat or across all chats, ignores case only for the ASCII letters A–Z. For any other letter the case must match exactly:
| Search | Message | Found |
|---|---|---|
test |
Testing |
yes |
über |
Über |
no |
привет |
Привет |
no |
γεια |
Γεια |
no |
straße |
STRASSE |
no |
This affects every language with letters outside ASCII (German, French, Russian, Ukrainian, Greek, Turkish, Polish, …), in all apps, because the search runs in the core.
To reproduce
- Receive a message "Über morgen".
- Search for "über" in the chat, or with
/_get items count=50 search=über. - No result. Searching "Über" finds it.
Cause
The SQLite queries compare LOWER(item_text) LIKE '%' || LOWER(?) || '%' (src/Simplex/Chat/Store/Messages.hs: searchCond in getChatItemIDs, which the single-chat loads use, and the three queries in getAllChatItems). SQLite's built-in LOWER() and LIKE fold ASCII only unless SQLite is built with ICU, which the bundled sqlcipher is not. The chat list's name filters (contact and group names, aliases) use the same LOWER(…) LIKE pattern and miss the same way.
Proposed fix
Register a deterministic scalar function when a SQLite connection is opened, e.g. simplex_fold(text), implemented with Data.Text.toCaseFold through Database.SQLite3.Direct.createFunction (available in the pinned direct-sqlcipher), and use it on both sides in the SQLite build only:
simplex_fold(item_text) LIKE '%' || simplex_fold(?) || '%'
- Registration fits next to the existing pragmas in
connectDB(simplexmq,Simplex.Messaging.Agent.Store.SQLite), so every connection in the pool has it. - The PostgreSQL build keeps
LOWER, which is already Unicode-aware there. toCaseFoldalso handles full folding (ß → ss) and the Turkish dotted İ.- Cost: one Haskell callback per scanned row instead of the built-in
LOWER. The search is already a full scan ofchat_items, so the difference should be measured on a large database before merging.
We would be happy to open a PR for this if the approach is acceptable.
- Langage dominant
- Haskell
- Étoiles
- 19.8k
- Forks
- 1.3k
- Merge moyen
- 1 j 6 h
- PR mergées (30 j)
- 233
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de simplex-chat/simplex-chat
-
bug triage
Difficulté 2/5 1-3 heures Accessibilité débutants 91/100
simplex-chat/simplex-chat#8372 ·
Les mainteneurs répondent en général sous 1 jour
-
bug desktop
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
simplex-chat/simplex-chat#8291 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement terminal
Difficulté 1/5 1-3 heures Accessibilité débutants 66/100
simplex-chat/simplex-chat#8043 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 77/100
simplex-chat/simplex-chat#7781 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
simplex-chat/simplex-chat#7714 · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de simplex-chat/simplex-chat
Issues similaires
-
area:client bug priority-low
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
compiler-explorer/compiler-explorer#9710 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
agda/agda#8965 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
http-semantics-0.5.0Ouvertefailure: bounds
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
commercialhaskell/stackage#8187 · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100