Android - LHN - Fix chats created offline#60708
Conversation
|
@rushatgabhane Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Assigned Ali from the linked issue |
|
🚧 @mountiny has triggered a test app build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
|
@alitoshmatov Let me take over this issue because the author want to speed it up |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-04-30.at.17.05.50.movAndroid: mWeb ChromeScreen.Recording.2025-04-30.at.17.00.11.moviOS: NativeiOS: mWeb SafariScreen.Recording.2025-04-30.at.17.01.24.movMacOS: Chrome / SafariScreen.Recording.2025-04-30.at.16.58.34.movMacOS: DesktopScreen.Recording.2025-04-30.at.17.03.06.mov |
Okay |
|
@JakubKorytko The change looks fine to me |
|
I will start on testing and complete the checklist soon |
mountiny
left a comment
There was a problem hiding this comment.
Appreciate the tests, thanks!
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.1.40-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.1.40-7 🚀
|
Explanation of Change
To create a new chat in this case the call stack is:
OptionRowLHNData -> getOptionData -> getReportName -> getReportNameInternal -> buildReportNameFromParticipantNamesThe problem is that when the user is offline the app creates an optimistic user, for example:
{ "accountID": 2124381355, "displayName": "delete+6@me.com", "login": "delete+6@me.com", "isOptimisticPersonalDetail": true }However, after the user comes back online,
buildReportNameFromParticipantNamesadds this user to the array of current participants (participantsWithoutCurrentUser), keeping the optimistic one in it because the report has not yet been fetched (until the user opens the report for the first time while being online).Then
getDisplayNameForParticipantreturns an empty string for the optimistic one, so a comma is added to the end of the string.We need to filter empty strings from displayNames and if the array has only one element after filtering, then we want to display the full name of that user.
Fixed Issues
$ #60616
PROPOSAL: N/A
Tests
Offline tests
Same as tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android.mp4
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop