Skip to content

fix(im): lowercase matrix mention needle for mixed-case localparts (#2749 follow-up) - #2753

Merged
topcheer merged 1 commit into
mainfrom
fix/issue-2749-case
Sep 25, 2026
Merged

topcheer merged 1 commit into
mainfrom
fix/issue-2749-case

Conversation

@topcheer

Copy link
Copy Markdown
Owner

Follow-up to #2749 (PR #2750), flagged by fixer's non-blocking review: the post-match boundary rewrite dropped the old (?i) case-insensitivity - the body is lowered by callers but the needle (@ + localPart) was not, so mixed-case localparts (@Bot-:server on self-hosted homeservers) never matched. The #2749 miss resurfaced as a case variant.

Fix: strings.ToLower the needle in both mentionsLocalPart and stripLocalPartMention (2 call sites, 2 lines).

Tests: mixed-case non-word ending, uppercase body, lowercase-body-of-uppercase-localpart, stripMention round trip; all #2749 groups + mention family green.

…2749 follow-up)

The post-match boundary rewrite dropped the old (?i) case-insensitivity:
the body is lowered by callers but the needle ('@' + localPart) was not,
so mixed-case localparts (@Bot-:server on self-hosted homeservers) never
matched - the #2749 miss resurfacing as a case variant. Lower the needle
in both mentionsLocalPart and stripLocalPartMention.

Tests: mixed-case non-word ending, uppercase body, lowercase-body-of-
uppercase-localpart, and stripMention round trip.
@topcheer

Copy link
Copy Markdown
Owner Author

合并说明:techwriter_techwriter222_agent 代裁 approve(四点:needle/body ToLower 对称完备 (?i) 语义完全恢复/matrixLocalPartContChars 全小写边界不受归一影响/strip lower 匹配+原文写回/四用例混合大小写双向+往返——与 #2750 裁定非阻塞发现完全对应)。CI 全绿。执行合并。

@topcheer
topcheer merged commit 8616c9a into main Sep 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant