Repository navigation
fix(Message): leave ids off mentions whose display text several entities share - #3464
Open
MartinCupela wants to merge 1 commit into
Open
MartinCupela wants to merge 1 commit into
MartinCupela wants to merge 1 commit into
Conversation
β¦ies share A message's text says only `@Alice`, so when it mentions two entities with that display text the mention cannot be resolved to one of them. Such a mention stays highlighted but has no data-mention-id or data-user-id, and keeps data-mention-type only when all candidates share it. The mention node gets mentionedEntities with every candidate; mentionedEntity keeps its type.
MartinCupela
requested review from
NikolaGoranNaumovski and
oliverlaz
as code owners
November 23, 2026 13:54
Contributor
|
Size Change: +1.1 kB (+0.1%) Total Size: 1.13 MB π¦ View Changed
βΉοΈ View Unchanged
|
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3464 +/- ##
==========================================
+ Coverage 91.54% 92.06% +0.51%
==========================================
Files 644 666 +22
Lines 21343 21638 +295
Branches 6752 6829 +77
==========================================
+ Hits 19539 19921 +382
+ Misses 1804 1717 -87 β View full report in Codecov by Harness. π New features to boost your workflow:
|
oliverlaz
approved these changes
Nov 23, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket: https://linear.app/stream/issue/REACT-1509
π― Goal
A message's text says only
@Alice; the ids live in separate, positionless mention fields. When the message mentions two entities with the same display text, e.g. two users named Alice, or a user namedadminand the roleadmin, the text does not say which of them each@Alicerefers to.createMentionLookupmapped each display text to the first entity with it, so these mentions rendered with the wrongdata-mention-id/data-user-id, and which entity won depended on the order of the mention fields.π Implementation details
createMentionLookupmaps each@<display text>to every distinct entity (type + id) with that text; the same entity listed twice counts once.mentionedEntities(all candidates).mentionedEntitykeeps its type and holds the first candidate, so custom renderers keep compiling.<Mention/>:data-mention-id,data-mention-typeand, for a user,data-user-id;data-mention-id/data-user-id, and keepsdata-mention-typeonly when all candidates share it.@channel,@here, a role or a user group is ambiguous with that entity, so the mention has no id and no type. The result no longer depends on the order of the mention fields.admin+ roleadmin, userchannel+@channel(and@here, user group), an unambiguous mention next to an ambiguous one, order independence, a duplicated entity, and what a custom renderer receives.ai-docs/ai-migration-v14-v15.mdsection 12 (mention handlers and custom mention renderers) and BC-088 inai-docs/v15-breaking-changes.md.No public API break. Dropping the id attributes only on ambiguous mentions is the intended behavior change.
Docs to update on getstream.io after merge:
02-ui-components/08-message/06-render-text.md,03-ui-cookbook/04-message/03-mentions_actions.md.π¨ UI Changes
None. Ambiguous mentions look the same; only their data attributes change.