Skip to content

fix: mentions rendered incorrectly - WPB-21687#4664

Open
johnxnguyen wants to merge 1 commit intodevelopfrom
fix/mention-rendering-wpb-21687
Open

fix: mentions rendered incorrectly - WPB-21687#4664
johnxnguyen wants to merge 1 commit intodevelopfrom
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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

Test Results

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

For more details on these failures, see this check.

Results for commit 5ac135c.

♻️ This comment has been updated with latest results.

Summary: workflow run #25311515090
Allure report (download zip): html-report-29661-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: 5ac135c | Docs | Give us feedback!

Copy link
Copy Markdown
Contributor

@samwyndham samwyndham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good but I'm torn to whether this fix should be done on iOS if it really is a bug coming from web. Perhaps we could consider this a temporary fix and add some additional logging to help identify the underlying issue. Is Android not affected by the bug also?

@johnxnguyen
Copy link
Copy Markdown
Collaborator Author

It looks good but I'm torn to whether this fix should be done on iOS if it really is a bug coming from web. Perhaps we could consider this a temporary fix and add some additional logging to help identify the underlying issue. Is Android not affected by the bug also?

Yes I also agree with you, but I can try to raise it with the web team but I don't know how quickly they would be able to address it. I'll keep it open for now and see if we can at least verify that the bug may be coming from their side.

@johnxnguyen johnxnguyen changed the base branch from release/cycle-4.18 to develop May 4, 2026 09:26
@johnxnguyen johnxnguyen force-pushed the fix/mention-rendering-wpb-21687 branch from 2a2ad3c to 5ac135c Compare May 4, 2026 09:29
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 4, 2026

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.

2 participants