-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HOLD for payment 2023-07-28] [$1000] Web -Default avatar is changed when we select/unselect a member in Workspace invitation page #22085
Comments
Triggered auto assignment to @dylanexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.When new user unregistered is being invited to a workspace via "Invite new members" page, selecting and deselecting the user row resulted in a change in avatar photo. What is the root cause of that problem?The userToInvite avatar icon is generated from App/src/libs/OptionsListUtils.js Line 801 in b0add94
What changes do you think we should make in order to solve the problem?We should generate number only hashCode out of lowercase search term (so that test@gmail.com & TEST@gmail.com returns the same avatar), to get a consistent positive number only accountID based on the new user login. function generateAccountID(login) {
// reusing hashCode, abs because hashCode can return negative number
return Math.abs(hashCode(login.toLowerCase()));
} All existing usages of UserUtils.generateAccountID will be modified to pass in user login.
for consistency across the app |
Job added to Upwork: https://www.upwork.com/jobs/~018119c930be0fc798 |
Current assignee @dylanexpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The default avatar of member is changed every time we select/unselect What is the root cause of that problem?We're using App/src/libs/OptionsListUtils.js Line 801 in 3e02ef4
optimisticAccountID will be regenerated every time and does not have any correlation with the login that is used as search query.
What changes do you think we should make in order to solve the problem?We need to use the user login (aka the search query) to generate the default avatar so we'll see the same consistent default avatar across all searches from different accounts. This was what was done before, reverting to it will not cause any issue with our new security practice of using the accountID (since we're not revealing any sensitive user data here, we're just showing the default avatar based on the search query/login that's typed in by the user) What alternative solutions did you explore? (Optional)Another way is to change the algorithm of generating the optimistic account ID a bit so that we can consistently generate the avatar.
|
ProposalPlease re-state the problem that we are trying to solve in this issue.The default avatar is changed whenever the member is unselected from the invitation page. What is the root cause of that problem?We use What changes do you think we should make in order to solve the problem?Generate function generateAccountID(login) {
// can't use hashText, it returns a 32bit integer
return hash(login);
// or
const hash = hashText(login)
return Number(`${hash}${hashText(login + hash)}`)
} |
I agree with @dukenv0307's proposal. I think we should generate optimistic account id based on the search term that the user entered. I also don't see any security implication of this. Before we proceed, I would like to get a confirmation about this from @Beamanator or @puneetlath since they've worked on it more extensively. |
Hi @allroundexperts, |
I agree no security implications - the optimistic account ID doesn't get to the backend and is only used on the frontend for these brand new accounts, so feel free to proceed with whichever proposal seems best 👍 |
@allroundexperts thanks for reviewing the proposals. Wondering if you have missed my proposal #22085 (comment) at the top which is about generating
I actually tried out what's proposed in @dukenv0307 's solution but found it works only in Workspace invite page, the bug stills occurs in other pages like Bill Splitting page with new user, where the avatar still changes when user is selected and and deselected. My proposal would fix it for all app pages. |
@honnamkuan I think with the approach you've suggested, we'll be getting different avatars for the same search term whenever the app is refreshed. Let me know if that is not the case. |
Yes we will get getting different avatar if user choose to search for a new user, then decide not proceed with what he is doing, refresh the app, and search for the same user again, but I think that is not something user would do in their usage workflow. On the plus side, given my fixings are done on |
I think we would want consistent avatars here. |
@allroundexperts thanks for the feedbacks, that is understandable. I have updated my proposal #22085 (comment) to propose hashing the lowercased login to get a positive number only accountID, and update all usages of the functions, that will ensures consistent avatar shown across all EApp pages and page refresh. Appreciate your review on it |
@akinwale may also have a proposal for this from a previous issue. |
Amended my comment above #22085 (comment) to provide better clarity on my findings regarding @dukenv0307 's proposal.
|
@honnamkuan The approach is the only thing that's needed in the proposal, whichever approach is selected will of course be applied across the app. I'm the first to suggest to |
I read your proposal again, sorry to say I have the same understanding as @DrLoopFall #22085 (comment) when it comes to your proposal.
If you ask me, the approach in mine (both previous and current one) and DrLoopFall's proposal is to generate Quoting summarised text from your proposal..
|
That seems reasonable to me. |
@dylanexpensify Can you please add payments summary here? |
Bump for payment summary @dylanexpensify |
Payment Summary:
Upwork job here |
@dylanexpensify I think this is eligible for bonus because it was reviewed / approved within 3 days. Can you please confirm? |
reviewing! |
Correct! Updating prices! |
Updated! Thanks @allroundexperts! |
@akinwale sent offer! |
Accepted, thanks! |
Everything done here - just pending C+ ND payout! |
@dylanexpensify can I get Issue reporter payout as well? Just back read chats. I agree that two issue are same root cause, but different steps to reproduce issue. |
That's fair, yes you can. Updated comment |
Paid @hoangzinh |
Thanks @dylanexpensify |
Waiting for @allroundexperts to be paid |
Reviewing today! |
@allroundexperts you're paid in NewDot right? |
@dylanexpensify Not yet. Usually, someone from the team posts a confirmation message here once paid. |
Ahh got it! Mind applying at the above job then? I'll get you sorted today! |
Thanks Dylan but I'll get paid through ND. I'm not in a rush so its fine if they're taking time to approve. |
Ah I see, I thought you meant not yet as in not paid via new dot yet 😅 sounds good! |
Reviewed the details for @allroundexperts. Approved for payment in NewDot based on the BZ summary above. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
The default avatar of member should be same every time we select/unselect
Actual Result:
The default avatar of member is changed every time we select/unselect
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.35
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
Notes/Photos/Videos: Any additional supporting documentation
Screen.Recording.2023-07-02.at.00.23.12.1.mov
Gravar.2736.mp4
Expensify/Expensify Issue URL:
Issue reported by: @hoangzinh
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688232507431689
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: