fix: mentions rendered incorrectly - WPB-21687#4664
fix: mentions rendered incorrectly - WPB-21687#4664johnxnguyen wants to merge 1 commit intodevelopfrom
Conversation
Test Results1 883 tests 1 855 ✅ 2m 11s ⏱️ 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 |
|
samwyndham
left a comment
There was a problem hiding this comment.
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. |
2a2ad3c to
5ac135c
Compare
|



Issue
It has been observed that in some cases mentions are rendered incorrectly, as shown here:

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 (encompassingBruno) 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:
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
[WPB-XXX].UI accessibility checklist
If your PR includes UI changes, please utilize this checklist: