Skip to content

fix: mentions rendered incorrectly - WPB-21687#4664

Open
johnxnguyen wants to merge 2 commits intorelease/cycle-4.18from
fix/mention-rendering-wpb-21687
Open

fix: mentions rendered incorrectly - WPB-21687#4664
johnxnguyen wants to merge 2 commits intorelease/cycle-4.18from
fix/mention-rendering-wpb-21687

Conversation

@johnxnguyen
Copy link
Copy Markdown
Collaborator

@johnxnguyen johnxnguyen commented Apr 30, 2026

BugWPB-21687 [iOS] Mentioned replaces first letter of name with '@'

Issue

It has been observed that in some cases mentions are rendered incorrectly, as shown here:
testThatItHandlesMalformedMentionRange_MissingAtSymbol 320-0 old

It's suspected that this is due to the sender of the text message incorrectly calculating the range of the mention to only include the name and not the the @ prefix. For instance, in the message Hello @Bruno! How are you? the mention range that is sent in the protobuf message should be location 6 with length 6 (encompassing @Bruno). But if instead the mention range is location 7 length 5 (encompassing Bruno) then the iOS app will render the mention incorrectly as shown in the previous attachment.

This PR accounts for this hypothetical case by checking if the mention range includes the prefix @. If it does not, it will check that the string has a @ prefix available and if it does will adjust the mention range to encompass also this @ prefix. Then it proceeds as normal with the mention rendering. The result is:

testThatItHandlesMalformedMentionRange_MissingAtSymbol 320-0

Testing

Since it is not know how to reproduce this hypothetical case, there are no steps. However it seems to have something to do with copying and pasting a message containing mentions on the web app and sending the message, then editing the message to apply the mentions.


Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Make sure you use the API for UI elements that support large fonts.
  • All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • New UI elements have Accessibility strings for VoiceOver.

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

Test Results

1 883 tests   1 855 ✅  2m 22s ⏱️
  301 suites     27 💤
    1 files        1 ❌

For more details on these failures, see this check.

Results for commit 2a2ad3c.

Summary: workflow run #25189422378
Allure report (download zip): html-report-29634-fix_mention-rendering-wpb-21687

@datadog-wireapp
Copy link
Copy Markdown

datadog-wireapp Bot commented Apr 30, 2026

Tests

Fix all issues with Cursor

⚠️ Warnings

🧪 1 Test failed

testThatItUsesCorrectUTF16OffsetForMention() from Wire-iOS-Tests.Message_FormattingTests   View in Datadog   (Fix with Cursor)
Test crashed with signal trap.

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2a2ad3c | Docs | Give us feedback!

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