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-07-10] [$250] Web - Workspace - Member is unselected when refresh Add message page and go back #42533
Version Number: 1.4.75-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: N/A Email or phone of affected tester (no customers):gocemate+a85@gmail.com Issue reported by: Applause - Internal Team
Action Performed:
Create Workspace
Go to Members> Invite> Enter any email> Next
Refresh the Add message page
Go back to Invite members page
Expected Result:
Member should be selected
Actual Result:
Member is not selected when refresh Add message page and go back to Invite members page
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
@dylanexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Please re-state the problem that we are trying to solve in this issue.
Workspace - Member is unselected when refresh Add message page and go back
What is the root cause of that problem?
On normal flow, on the Invite new memeber screen, when we slect a contact and we click on Next, going to the "Add message screen", the previous page "Invite new memeber" will not disappear, it will still rendered but hidden.
All the data inside "Invite new memeber" will be available when we hit the Back button. But when we refresh the "Add message screen", we will loose the selected contact inside "Invite new memeber".
Same thing will happen if we are on the "Invite new memeber" and we refresh it without going to the "Add message screen, we will loose the selected contact.
The issue is that WorkspaceInvitePage when we select contact and click next for the "Add message screen", there's a WorkspaceInviteMembersDraft created
btw, i also noticed that the invite page could load infinitely when refreshed which was fixed before in #22508 but gets broke again in #38039. maybe we can create a new issue and use the same solution that I use in #22508
changed the title [-][$250] Web - Workspace - Member is unselected when refresh Add message page and go back[/-][+][HOLD for payment 2024-07-10] [$250] Web - Workspace - Member is unselected when refresh Add message page and go back[/+]on Jul 3, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.3-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 fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@ishpaul777] The PR that introduced the bug has been identified. Link to the PR:
[@ishpaul777] 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:
[@ishpaul777] 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:
[@ishpaul777] Determine if we should create a regression test for this bug.
[@ishpaul777] 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.
[@dylanexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Activity
melvin-bot commentedon May 23, 2024
Triggered auto assignment to @dylanexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.lanitochka17 commentedon May 23, 2024
@dylanexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
dragnoir commentedon May 23, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Workspace - Member is unselected when refresh Add message page and go back
What is the root cause of that problem?
On normal flow, on the Invite new memeber screen, when we slect a contact and we click on Next, going to the "Add message screen", the previous page "Invite new memeber" will not disappear, it will still rendered but hidden.
All the data inside "Invite new memeber" will be available when we hit the Back button. But when we refresh the "Add message screen", we will loose the selected contact inside "Invite new memeber".
Same thing will happen if we are on the "Invite new memeber" and we refresh it without going to the "Add message screen, we will loose the selected contact.
The issue is that
WorkspaceInvitePagewhen we select contact and click next for the "Add message screen", there's aWorkspaceInviteMembersDraftcreatedApp/src/pages/workspace/WorkspaceInvitePage.tsx
Line 246 in 2c9cc0a
but when we refresh the page or we reopen it, we don't check the data inside that
WorkspaceInvitePage.What changes do you think we should make in order to solve the problem?
We need to add an utility to check the data inside
WorkspaceInvitePagewhen the page load or the compounent mout withuseEffectWe need to check OnyxData
as we do for the
WorkspaceInviteMessagePageApp/src/pages/workspace/WorkspaceInviteMessagePage.tsx
Lines 231 to 233 in 2c9cc0a
If
invitedEmailsToAccountIDsis not empty, then we need to add those to the selected list.bernhardoj commentedon May 24, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The previously selected member is gone when refresh in message page and go back.
What is the root cause of that problem?
This previously worked but was broken by #38207.
We have a logic here to add back the saved selected user,
App/src/pages/workspace/WorkspaceInvitePage.tsx
Lines 111 to 120 in 8375abe
however, the
detailsMapis empty, so it always returns early. The reason it's empty is because the data insideinviteOptionsis also emptyApp/src/pages/workspace/WorkspaceInvitePage.tsx
Lines 99 to 108 in 8375abe
because we only initialize the data when the screen transition ends (didScreenTransitionEnd).
App/src/pages/workspace/WorkspaceInvitePage.tsx
Lines 72 to 74 in 8375abe
So, basically, the data is not ready yet, but we already trying to add back the selected user.
What changes do you think we should make in order to solve the problem?
We should return early at the above when the data is not ready yet, preventing any logic inside the effect to run.
App/src/pages/workspace/WorkspaceInvitePage.tsx
Lines 94 to 120 in 8375abe
btw, i also noticed that the invite page could load infinitely when refreshed which was fixed before in #22508 but gets broke again in #38039. maybe we can create a new issue and use the same solution that I use in #22508
melvin-bot commentedon May 28, 2024
@dylanexpensify Huh... This is 4 days overdue. Who can take care of this?
dylanexpensify commentedon May 29, 2024
reviewing!
melvin-bot commentedon Jun 3, 2024
@dylanexpensify Huh... This is 4 days overdue. Who can take care of this?
dylanexpensify commentedon Jun 5, 2024
Hmm couldn't repro, @bernhardoj can you?
38 remaining items
[-][$250] Web - Workspace - Member is unselected when refresh Add message page and go back[/-][+][HOLD for payment 2024-07-10] [$250] Web - Workspace - Member is unselected when refresh Add message page and go back[/+]melvin-bot commentedon Jul 3, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jul 3, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.3-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-07-10. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jul 3, 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:
dylanexpensify commentedon Jul 10, 2024
payment coming up!
dylanexpensify commentedon Jul 12, 2024
Payment summary:
Please apply/request!
dylanexpensify commentedon Jul 12, 2024
done!