-
Notifications
You must be signed in to change notification settings - Fork 3k
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 2024-12-03] [$250] Workspace members - User is not highlighted briefly in the table after being invited #52479
Comments
Triggered auto assignment to @sakluger ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The user is not highlighted briefly in the table after being invited What is the root cause of that problem?We clear workspace invite member draft Onyx data on App/src/pages/workspace/WorkspaceInvitePage.tsx Lines 71 to 74 in 7960b7d
Later in App/src/pages/workspace/WorkspaceMembersPage.tsx Lines 414 to 418 in 4eaf05f
So the invited members data is cleared before it's checked in the above effects so What changes do you think we should make in order to solve the problem?We should delay the |
ProposalPlease re-state the problem that we are trying to solve in this issue.The user is not highlighted briefly in the table after being invited What is the root cause of that problem?After we invite members, the draft invite members is cleared before App/src/pages/workspace/WorkspaceInvitePage.tsx Lines 70 to 75 in b1c1a4b
It leads App/src/pages/workspace/WorkspaceMembersPage.tsx Lines 410 to 418 in b1c1a4b
What changes do you think we should make in order to solve the problem?If the invite API is called here, we should not clear the draft invite members because we've cleared it after highlighting the new members here App/src/pages/workspace/WorkspaceInvitePage.tsx Lines 70 to 75 in b1c1a4b
App/src/pages/workspace/WorkspaceInvitePage.tsx Lines 70 to 75 in b1c1a4b
What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.User is not highlighted for a moment after adding it to workspace. What is the root cause of that problem?We highlight the new member if the page is focused, the accountID list changes, and there is an invite member draft. App/src/pages/workspace/WorkspaceMembersPage.tsx Lines 411 to 420 in b1c1a4b
However, after inviting new users, the App/src/pages/workspace/WorkspaceInvitePage.tsx Lines 70 to 76 in b1c1a4b
So the users are never highlighted because the draft is cleared. This happens after #51227. But after fixing the above problem, the issue still happens when we invite users that we never chatted with before. In that case, the user is disabled.
App/src/components/SelectionList/BaseListItem.tsx Lines 101 to 104 in b1c1a4b
Lines 1127 to 1138 in b1c1a4b
It's to fix #51984. What changes do you think we should make in order to solve the problem?We should clear the draft only if the invite page is focused. App/src/pages/workspace/WorkspaceInvitePage.tsx Lines 70 to 76 in b1c1a4b
The original logic was added to solve this issue where the invite member draft is not cleared when we close the page.
After applying the above changes, the invite member draft won't be cleared if we open the invite page > invite message page > then press the overlay. But on prod, it's also not cleared if we refresh while on the message page and close the RHP from the overlay. If we want, we can clear it in the invite message page too, but only if App/src/pages/workspace/WorkspaceInviteMessagePage.tsx Lines 100 to 107 in 1b9e302
Now, to fix the disabled new member not getting highlighted, we need to separate the App/src/components/SelectionList/BaseSelectionList.tsx Lines 490 to 499 in 1b9e302
And if
We need to update |
The current behavior shown in the video looks fine to me. I'm checking with the team in Slack (https://expensify.slack.com/archives/C06ML6X0W9L/p1731515655449829) to see if this should be considered a bug or not. |
Job added to Upwork: https://www.upwork.com/jobs/~021856768422191044805 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @suneox ( |
I got confirmation that the expected behavior is correct in the OP. Let's fix it! |
I was asked to clarify the intended behavior after inviting a new member to a workspace:
|
Edited by proposal-police: This proposal was edited at 2024-11-14 07:19:45 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.User is not highlighted briefly in the table after being invited What is the root cause of that problem?Before returning to the workspace members, we set App/src/pages/workspace/WorkspaceInvitePage.tsx Lines 70 to 76 in 04402e9
This code checks if
We set What changes do you think we should make in order to solve the problem?To resolve this issue, we should check for changes in the accountIDs list. If there are new accountIDs, we will scroll and highlight them. The code will be:
useEffect(() => {
if (!isFocused) {
return;
}
// We check if accountIDs haven't changed, then return
+ if (accountIDs === prevAccountIDs) {
+ return;
+ }
// We check if one or more members were removed from accountIDs, then return
+ if (accountIDs.length < prevAccountIDs.length) {
+ return;
+ }
+ const diffAccountIDs = accountIDs.filter((id) => !prevAccountIDs.includes(id));
// If no account changes, return early
+ if (!isEmptyObject(invitedEmailsToAccountIDsDraft) && !diffAccountIDs.length) {
+ return;
+ }
- if (isEmptyObject(invitedEmailsToAccountIDsDraft) || accountIDs === prevAccountIDs) {
- return;
- }
- const invitedEmails = Object.values(invitedEmailsToAccountIDsDraft).map(String);
- selectionListRef.current?.scrollAndHighlightItem?.(invitedEmails, 1500);
+ selectionListRef.current?.scrollAndHighlightItem?.(
+ diffAccountIDs.map((item) => String(item)),
+ 1500,
+ );
Member.setWorkspaceInviteMembersDraft(route.params.policyID, {});
}, [invitedEmailsToAccountIDsDraft, route.params.policyID, isFocused, accountIDs, prevAccountIDs]);
Test branchPOCScreen.Recording.2024-11-14.at.14.17.32.mp4What alternative solutions did you explore? (Optional) |
Thanks for all the proposals. The RCA from @bernhardoj proposal is correct—this issue occurred after merging PR #51227. His proposal also supports updating a custom highlighted BG, so we can proceed with this proposal 🎀 👀 🎀 C+ reviewed
@sakluger We need to confirm whether the expected highlight background should look like the one Screen.Recording.2024-11-17.at.21.34.56.mp4or if we need a different background color? |
Triggered auto assignment to @techievivek, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
cc @Expensify/design could you please help verify the correct highlight color for when a new member is invited to a workspace? Can we use the same color as we do on the Expenses page as shown in the comment above? |
Yes I think we should use the same highlight pattern we use for expenses on the search page. |
Agree |
Agree three |
📣 @suneox 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
PR is ready cc: @suneox |
Same same. One highlight pattern to rule them all. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.66-8 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-12-03. 🎊 For reference, here are some details about the assignees on this issue:
|
@suneox @sakluger @suneox The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
Hey @suneox, please complete the BZ checklist before the payment due date tomorrow. Thanks! |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
|
Summarizing payment on this issue: Contributor: @bernhardoj $250, please request via NewDot |
$250 approved for @bernhardoj |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.61-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): applausetester+kh021101@applause.expensifail.com
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
The user will be highlighted briefly in the table after being invited. (previous behavior can be seen in this issue video #51788
).
Actual Result:
The user is not highlighted briefly in the table after being invited
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6663576_1731492388923.20241113_180239.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: