You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-01-11] [$500] LHN - When receiving a large message with empty lines, the LHN does not display "..." #32497
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: 1.4.8-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
Action Performed:
Open New Expensify app
Navigate to any conversation
Send a message containing text and empty lines, for example:
"Hello
Hi"
Expected Result:
Any message received by the user that does not fit completely into the preview in LHN should be displayed with "..." at the end of the preview
Actual Result:
When receiving a large message with empty lines, the LHN does not display "..."
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]LHN - When receiving a large message with empty lines, the LHN does not display "..."[/-][+][$500] LHN - When receiving a large message with empty lines, the LHN does not display "..."[/+]on Dec 5, 2023
What changes do you think we should make in order to solve the problem?
Since the oldlastMessage values only store half the text, we can use lastMessageHtml instead and then using parser.htmlToText get text and to make the text on one line and remove line breaks, we can use replace(/\n/g, ' ')
Plus we need update optimisticReport for lastMessageHTML while we are waiting for the result from the backend since for optimisticReport we use only part of text for lastMessageHTML (or we can pass lastAction.message[0].html instead report.lastMessageHtml in first part )
Please re-state the problem that we are trying to solve in this issue.
Receiving a large message with empty lines, LHN doesn't display ...
What is the root cause of that problem?
We format the last message text to only the text in the first line of text in the last action and BE also has the same approach.
So if the first line is short text LHN display without ...
What changes do you think we should make in order to solve the problem?
When we format the last message text, we can replace all line breaks with space characters and then substring this text. This is the approach that is used by Messenger of Facebook
What alternative solutions did you explore? (Optional)
If we don't want to change this in back-end, we can use this approach lastMessageTextFromReport function. But I'd like to fix back-end logic and formatReportLastMessageText function so lastMessageText in report data is synced and we can use this in all places of the App without any more change.
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.21-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-01-11. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
External issue reporter
Contributor that fixed the issue
Contributor+ that helped on the issue and/or PR
For reference, here are some details about the assignees on this issue:
@mollfpr requires payment (Needs manual offer from BZ)
@dukenv0307 requires payment (Needs manual offer from BZ)
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
[@mollfpr] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@mollfpr] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@mollfpr] Determine if we should create a regression test for this bug.
[@mollfpr] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@sakluger] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
@mollfpr are you still requesting via NewDot, or should I send you an offer via Upwork? Either way, could you please complete the BZ checklist? Thanks!
[@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
[@mollfpr] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
No offending PR. This improvement and we do need the BE change to solved this issue.
[@mollfpr] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
The regression step should be good.
[@mollfpr] Determine if we should create a regression test for this bug.
[@mollfpr] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
Open a chat
Send a message with some lines break, and the first line is short
Verify that in LHN, the last message is displayed with ...
👍 or 👎
@sakluger I'll be requesting through NewDot; thank you!
@mollfpr for the regression test steps, I'm thinking we should provide some samples to make it more clear what the expected result should be:
Input:
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum
Expected result: The LHN displays the message truncated to 79 characters & with an ellipses ... at the end.
Input:
Lorem Ipsum is simply dummy text
of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus
Expected result: The chat in the LHN shows the first line, followed by a space and then a few characters of the second line ending with ...
Input:
Line 1
Line 2
Line 3
Expected result: The chat in the LHN shows all three lines of the message separated by a space
Reacted by Mohammad Luthfi Fathur Rahman and Sasha Kluger
Thanks @mollfpr, and thanks @MariaHCD for the added suggestion, I agree that including specifics of what to type is helpful in regression tests to guarantee the tests are carried out consistently.
@dukenv0307 can you please accept the Upwork offer and let me know once you have? Thanks!
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Dec 5, 2023
Triggered auto assignment to @sakluger (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.[-]LHN - When receiving a large message with empty lines, the LHN does not display "..."[/-][+][$500] LHN - When receiving a large message with empty lines, the LHN does not display "..."[/+]melvin-bot commentedon Dec 5, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01bb7a63f85d985319
melvin-bot commentedon Dec 5, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Dec 5, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr (
External)ZhenjaHorbach commentedon Dec 5, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
LHN - When receiving a large message with empty lines, the LHN does not display
What is the root cause of that problem?
The main problem is that as alt text we use the
lastMessagefrom report which by default truncates all text after a newlineApp/src/libs/ReportUtils.ts
Line 1148 in f80fbe3
What changes do you think we should make in order to solve the problem?
Since the old
lastMessagevalues only store half the text, we can uselastMessageHtmlinstead and then usingparser.htmlToTextget text and to make the text on one line and remove line breaks, we can usereplace(/\n/g, ' ')As result
lastMessageTextFromReport = report ? parser.htmlToText(report.lastMessageHtml).replace(/\n/g, ' ') || '' : '';App/src/libs/OptionsListUtils.js
Line 416 in f80fbe3
Plus we need update optimisticReport for lastMessageHTML while we are waiting for the result from the backend since for optimisticReport we use only part of text for lastMessageHTML (or we can pass
lastAction.message[0].htmlinstead report.lastMessageHtml in first part )lastMessageHtml: lastAction.message[0].html,App/src/libs/actions/Report.js
Line 326 in 2975048
What alternative solutions did you explore? (Optional)
As alternative
If we don't want to make changes to
OptionsListUtilswe can return HTML text from getOptionDataApp/src/components/LHNOptionsList/OptionRowLHNData.js
Line 90 in f80fbe3
And then use parser for text inside
OptionRowLHNApp/src/components/LHNOptionsList/OptionRowLHN.js
Lines 258 to 266 in f80fbe3
sakluger commentedon Dec 8, 2023
@mollfpr what do you think about the one proposal we've received so far?
dukenv0307 commentedon Dec 8, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Receiving a large message with empty lines, LHN doesn't display
...What is the root cause of that problem?
We format the last message text to only the text in the first line of text in the last action and BE also has the same approach.
So if the first line is short text LHN display without
...App/src/libs/ReportUtils.ts
Line 1162 in 6129c67
What changes do you think we should make in order to solve the problem?
When we format the last message text, we can replace all line breaks with space characters and then substring this text. This is the approach that is used by
Messengerof FacebookThe back end also needs to use this approach to save the
lastMessageTextfield.App/src/libs/ReportUtils.ts
Line 1162 in 6129c67
What alternative solutions did you explore? (Optional)
If we don't want to change this in back-end, we can use this approach
lastMessageTextFromReportfunction. But I'd like to fix back-end logic andformatReportLastMessageTextfunction solastMessageTextin report data is synced and we can use this in all places of the App without any more change.App/src/libs/OptionsListUtils.js
Line 416 in f80fbe3
Result
Screen.Recording.2023-12-08.at.16.48.56.mov
31 remaining items
melvin-bot commentedon Jan 4, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.21-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-01-11. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jan 4, 2024
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
melvin-bot commentedon Jan 11, 2024
Payment Summary
Upwork Job
BugZero Checklist (@sakluger)
sakluger commentedon Jan 11, 2024
Sent an offer to @dukenv0307.
@mollfpr are you still requesting via NewDot, or should I send you an offer via Upwork? Either way, could you please complete the BZ checklist? Thanks!
mollfpr commentedon Jan 12, 2024
No offending PR. This improvement and we do need the BE change to solved this issue.
The regression step should be good.
...@sakluger I'll be requesting through NewDot; thank you!
MariaHCD commentedon Jan 12, 2024
@mollfpr for the regression test steps, I'm thinking we should provide some samples to make it more clear what the expected result should be:
Input:
Expected result: The LHN displays the message truncated to 79 characters & with an ellipses
...at the end.Input:
Expected result: The chat in the LHN shows the first line, followed by a space and then a few characters of the second line ending with
...Input:
Expected result: The chat in the LHN shows all three lines of the message separated by a space
sakluger commentedon Jan 13, 2024
Thanks @mollfpr, and thanks @MariaHCD for the added suggestion, I agree that including specifics of what to type is helpful in regression tests to guarantee the tests are carried out consistently.
@dukenv0307 can you please accept the Upwork offer and let me know once you have? Thanks!
JmillsExpensify commentedon Jan 14, 2024
$500 payment approved for @mollfpr based on this comment.
dukenv0307 commentedon Jan 15, 2024
@sakluger I accepted, thank you!
sakluger commentedon Jan 15, 2024
Thanks! I've finished paying out the contract, all done here.