Sentence-ending period is included in user and channel mentions ("thanks @john." mentions "john.")
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 20/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- backend-api-design
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 46.5k
- Fork
- 14.1k
- Merge medio
- 1g 21h
- PR unite (30g)
- 381
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di RocketChat/Rocket.Chat
-
Mark the empty state busy while a new search loads, like the table */}Forse già presa @aditya25bcy10173-a11y l’ha presa 2 giorni fa. Apertatodo type: feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
RocketChat/Rocket.Chat#43699 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Timestamp with a time but no timezone shows as 1 January 1970Forse già presa @Sarthak-agrawal-tech l’ha presa 4 giorni fa. Apertatype: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
RocketChat/Rocket.Chat#43637 · 6 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Move this mapping from useQuery's old `select` into a usePaginatedQuery `combine`Forse già presa @aditya25bcy10173-a11y l’ha presa 3 giorni fa. Apertatodo type: feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
RocketChat/Rocket.Chat#43609 · 4 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
evaluate switching to the other tab when the selected tab's permission is revoked mid-sessionForse già presa @schizophrenicmaniac l’ha presa 4 giorni fa. Apertatodo type: feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
RocketChat/Rocket.Chat#43579 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Docs say packages can be installed with `npm` but use unsupported `patch:` URLForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertatype: bug
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
RocketChat/Rocket.Chat#43554 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di RocketChat/Rocket.Chat
Issue simili
-
Bug: Broken RTL / BiDi text rendering when mixing Persian (Farsi) with English or numbersForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 2/5 Mezza giornata Idoneità per principianti 68/100
amosblomqvist/learnharness#758 ·
I maintainer di solito rispondono entro 2 giorni
-
Change WorkspacesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
bitfocus/companion-module-renewedvision-propresenter-api#134 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
rcpch/digital-growth-charts-react-component-library#304 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
dsh-market/dsh-market#1210 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
trustjonathan/STUDY-HUB#13 ·