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-02-14] [HOLD for payment 2024-01-18] Consolidate GetDislplayName methods #31312
We have a bunch of different methods that are used to get the display name:
PersonalDetails.getDisplayNameForTypingIndicator
PersonalDetails.getDisplayName
ReportUtils.getDisplayNamesStringFromTooltips
ReportUtils.getDisplayNameForParticipant
ReportUtils.getDisplayNamesWithTooltips
PersonalDetailsUtils.getDisplayNameOrDefault
I would like to do two things:
Conslidate these as much as possible. They probably can't all be consolidated, but I would think at least PersonalDetailsUtils.getDisplayNameOrDefault and PersonalDetails.getDisplayName and ReportUtils.getDisplayNameForParticipant could be
Make sure that we are falling back on the login if we have it. Right now ReportUtils.getDisplayNameForParticipant doesn't fall back on the login, even if it is available, and I would like to update it to do so
@puneetlath I've analyzed the methods you mentioned and looking for another parts of code that have to do something with creating a displayName. For now leaving my findings for each method:
PersonalDetails.getDisplayNameForTypingIndicator
only used in:
and it uses getDisplayNamesWithTooltips. So we're creating a list of objects just to extract a display name from them 🤔. I think this logic should be simplified not to iterate over a list twice
ReportUtils.getDisplayNameForParticipant
maybe we could replace this method, getDisplayName and getDisplayNameOrDefault and create one that will be used instead of these 3
ReportUtils.getDisplayNamesWithTooltips
iterates over personalDetailsList array, uses getDisplayNameForParticipant
PersonalDetailsUtils.getDisplayNameOrDefault
same as in getDisplayNameForParticipant
for your PR - I think we can merge it and then I will work on mine. I would rather split the whole refactor into several smaller PRs. It would be easier to test for regressions.
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.37-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@situchan] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
[@puneetlath] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.
@puneetlath I suggested to merge getDisplayNameForParticipant with getDisplayNameOrDefault. It's a big change, I'm still looking if there won't be any edge cases and we can use only one method everywhere.
@puneetlath After analyzing the usages of both methods I'm not convinced that we should go with merging them - they are slightly different and I would need to introduce an additional layer of complexity to cover all the cases. For now, I think that both methods serve their purpose in the places they are used and are easy to use.
If you agree, we can close this issue.
Activity
melvin-bot commentedon Nov 14, 2023
Current assignee @puneetlath is eligible for the NewFeature assigner, not assigning anyone new.
koko57 commentedon Nov 15, 2023
ready to work on this issue
koko57 commentedon Nov 16, 2023
@puneetlath I've analyzed the methods you mentioned and looking for another parts of code that have to do something with creating a displayName. For now leaving my findings for each method:
only used in:
App/src/pages/home/report/ReportTypingIndicator.js
Lines 45 to 46 in 47c7819
it could be possibly merged with getDisplayNameOrDefault and getDisplayNameForParticipant
it's only used here:
App/src/libs/GroupChatUtils.ts
Lines 16 to 22 in 47c7819
and it uses
getDisplayNamesWithTooltips. So we're creating a list of objects just to extract a display name from them 🤔. I think this logic should be simplified not to iterate over a list twicemaybe we could replace this method, getDisplayName and getDisplayNameOrDefault and create one that will be used instead of these 3
iterates over personalDetailsList array, uses
getDisplayNameForParticipantsame as in getDisplayNameForParticipant
koko57 commentedon Nov 16, 2023
for your PR - I think we can merge it and then I will work on mine. I would rather split the whole refactor into several smaller PRs. It would be easier to test for regressions.
puneetlath commentedon Nov 16, 2023
Ok sounds good. I'll get it ready for review.
puneetlath commentedon Nov 16, 2023
@koko57 my PR was merged.
78 remaining items
melvin-bot commentedon Feb 7, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Feb 7, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.37-7 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-02-14. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Feb 7, 2024
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
koko57 commentedon Feb 7, 2024
@puneetlath I suggested to merge getDisplayNameForParticipant with getDisplayNameOrDefault. It's a big change, I'm still looking if there won't be any edge cases and we can use only one method everywhere.
puneetlath commentedon Feb 7, 2024
Ok, sounds good. Thanks for keeping me in the loop.
koko57 commentedon Feb 14, 2024
@puneetlath After analyzing the usages of both methods I'm not convinced that we should go with merging them - they are slightly different and I would need to introduce an additional layer of complexity to cover all the cases. For now, I think that both methods serve their purpose in the places they are used and are easy to use.
If you agree, we can close this issue.
melvin-bot commentedon Feb 14, 2024
Payment Summary
Upwork Job
BugZero Checklist (@puneetlath)
puneetlath commentedon Feb 14, 2024
Ok sounds good to me. @situchan do you agree?
Thanks for all your effort on this @koko57!
situchan commentedon Feb 14, 2024
Agree. Thanks
puneetlath commentedon Feb 14, 2024
Ok sounds good. @situchan I see two "payment summary" posts in the issue. Is that correct? I feel like there were more PRs than that 😅
situchan commentedon Feb 14, 2024
puneetlath commentedon Feb 14, 2024
Great, thanks. Offer sent: https://www.upwork.com/nx/wm/offer/100915132
Please ping me here when you've accepted.
situchan commentedon Feb 14, 2024
Accepted thanks
puneetlath commentedon Feb 14, 2024
Paid. Thanks y'all!