Sentence-ending period is included in user and channel mentions ("thanks @john." mentions "john.")
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 20/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- typescript
- Área
- backend-api-design
Línea de trabajo
The issue points to UserMentionDirect, ChannelMention, and UTF8NamesValidation in @rocket.chat/message-parser, and cites tests/mention.test.ts. Read the existing mention tests and inspect how trailing punctuation is parsed. Done means sentence-ending periods are excluded from mentions while the existing username-ending-in-period case is addressed; the issue says a fix and tests are already in a PR.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
When a message ends a sentence with a mention, the period is parsed as part of the username or channel name.
| Input | Parsed mention | Expected |
|---|---|---|
thanks @john. |
john. |
john |
see #general. |
general. |
general |
@john... |
john... |
john |
! and ? already work as expected (ask @john! mentions john), so only . is affected.
Since Mentions.execute builds message.mentions from the parsed message.md when it exists, the server then looks up a user named john.. As far as I can tell this means the intended user isn't added to mentions and doesn't get the mention notification or highlight.
Steps to reproduce
- Send
thanks @<existing username>.in a room. - The mention isn't rendered or notified for that user.
In @rocket.chat/message-parser:
parse('thanks @john.');
// MENTION_USER 'john.' instead of MENTION_USER 'john' + PLAIN_TEXT '.'
Cause
UserMentionDirect and ChannelMention use UTF8NamesValidation = $([-_.] / AlphaNumericChar)+, which accepts a trailing ..
Trade-off to discuss
The default UTF8_User_Names_Validation ([0-9a-zA-Z-_.]+) technically allows usernames that end in ., and tests/mention.test.ts currently expects @guilherme.gazzo. to mention guilherme.gazzo.. Dropping the trailing period would change that case. Ending a sentence with a mention seems much more common than a username ending in ., and this matches how Slack, GitHub and Discord handle it, but I'd like a maintainer's view on whether the change is acceptable.
I've opened a PR with a fix and tests.
- Lenguaje dominante
- TypeScript
- Estrellas
- 46.5k
- Forks
- 14.1k
- Merge medio
- 1 d 21 h
- PR fusionados (30 d)
- 381
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de RocketChat/Rocket.Chat
-
Mark the empty state busy while a new search loads, like the table */}Posiblemente ocupada @aditya25bcy10173-a11y la tomó hace 2 días. Abiertotodo type: feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
RocketChat/Rocket.Chat#43699 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Timestamp with a time but no timezone shows as 1 January 1970Posiblemente ocupada @Sarthak-agrawal-tech la tomó hace 4 días. Abiertotype: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
RocketChat/Rocket.Chat#43637 · 6 comentarios ·
Los mantenedores suelen responder en 1 día
-
Move this mapping from useQuery's old `select` into a usePaginatedQuery `combine`Posiblemente ocupada @aditya25bcy10173-a11y la tomó hace 3 días. Abiertotodo type: feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
RocketChat/Rocket.Chat#43609 · 4 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
evaluate switching to the other tab when the selected tab's permission is revoked mid-sessionPosiblemente ocupada @schizophrenicmaniac la tomó hace 4 días. Abiertotodo type: feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
RocketChat/Rocket.Chat#43579 · 3 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Docs say packages can be installed with `npm` but use unsupported `patch:` URLPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertotype: bug
Dificultad 1/5 1-3 horas Aptitud para principiantes 72/100
RocketChat/Rocket.Chat#43554 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de RocketChat/Rocket.Chat
Issues similares
-
Out of order / duplicate key error shows the key bytes as decimal or UTF-8, not hexPosiblemente ocupada @bardrop la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
-
`/leaderboard`, the page and the share image say "be the first" for a program that hasn't startedAbiertobug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
codercops/discord-bot#152 ·
Los mantenedores suelen responder en 1 día
-
bug i18n
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
endora-commerce/endora-commerce#1315 ·
Los mantenedores suelen responder en 1 día
-
Two stored artist rows are not act names: "DJS" from a Renate floor heading and "Stevie Cox -"Abiertoarea:data-quality importer size:S
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
enorm-labs/event-junkie#5136 ·
Los mantenedores suelen responder en 1 día
-
fix(scripts): set-device-owner.ps1 fails to parse on Windows PowerShell 5.1 (UTF-8 without BOM)Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día