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-10-07] Workspace - Invite message comes back after deleting it #49899
Version Number: 9.0.41-2 Reproducible in staging?: Y Reproducible in production?: N 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+ds@applause.expensifail.com Issue reported by: Applause - Internal Team
Action Performed:
Login to an account
Create a workspace
Go to the created workspace > Members
Click on invite member > Choose a user
On "add message" page try to delete the message
Expected Result:
Message is deleted
Actual Result:
The deleted message comes back
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Please re-state the problem that we are trying to solve in this issue.
when a user deletes the invite message in the workspace invite process, the message reappears unexpectedly.
What is the root cause of that problem?
The root cause of this problem is that the component was automatically resetting the welcome message to its default value, even when the user had intentionally deleted it
What changes do you think we should make in order to solve the problem?
we should update the useEffect to add a check that skips resetting the invite message if it is already empty. This ensures that when the user deletes the message, it doesn't get reset to the default value.
Yeah this was caused by PR #48660 and issue #34929 . We can just remove that new useEffect but I'm not sure what the point of it was originally, so pinged the PR authors. Thanks!
Yeah this was caused by PR #48660 and issue #34929 .
@dangrous Yeah. Fixing an eslint error (i.e. using useOnyx instead of withOnyx) during some last-minute changes caused this issue. I think we can consider this as a separate issue. Please assign me here as I have the context.
We can just remove that new useEffect but I'm not sure what the point of it was originally, so pinged the PR authors. Thanks!
We need the second useEffect to ensure workspaceInviteMessageDraft is populated from the Onyx. However, an edge case got left out i.e. when the user intentionally deletes the entire welcome note in which case we should not reset. @Shahidullah-Muffakirproposal LGTM
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:
[@rojiphil] The PR that introduced the bug has been identified. Link to the PR:
[@rojiphil] 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:
[@rojiphil] 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:
[@rojiphil] Determine if we should create a regression test for this bug.
[@rojiphil] 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.
[@JmillsExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
[@rojiphil] The PR that introduced the bug has been identified. Link to the PR: Offending PR
[@rojiphil] 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: Added comment
[@rojiphil] 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: Not Required. Existing checklist is good enough to capture such issues.
[@rojiphil] Determine if we should create a regression test for this bug. : Yes. We can
[@rojiphil] 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.
Steps:
Go to Account Settings -> Workspaces
Select a workspace and go to Members->Invite new members
Select a member to invite and click on Next to go to the invite message view.
Delete the default welcome message text.
Verify that the message text remains empty and does not come back.
Activity
melvin-bot commentedon Sep 29, 2024
Triggered auto assignment to @dangrous (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.github-actions commentedon Sep 29, 2024
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Nodebrute commentedon Sep 29, 2024
Edited by proposal-police: This proposal was edited at 2024-09-29 18:55:32 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Invite message comes back after deleting it
What is the root cause of that problem?
We are setting
setWelcomeNote(getDefaultWelcomeNote())again hereApp/src/pages/workspace/WorkspaceInviteMessagePage.tsx
Lines 89 to 94 in 3047c1b
What changes do you think we should make in order to solve the problem?
We can remove this code block
App/src/pages/workspace/WorkspaceInviteMessagePage.tsx
Lines 89 to 94 in 3047c1b
We should test the code to make sure everything is working properly
What alternative solutions did you explore? (Optional)
Krishna2323 commentedon Sep 29, 2024
Edited by proposal-police: This proposal was edited at 2024-09-29 19:17:45 UTC.
Proposal
Offending PR: #48660
Please re-state the problem that we are trying to solve in this issue.
Workspace - Invite message comes back after deleting it
What is the root cause of that problem?
useEffecthooks to set the welcome note when the component mounts or the members change.App/src/pages/workspace/WorkspaceInviteMessagePage.tsx
Lines 77 to 94 in 3047c1b
What changes do you think we should make in order to solve the problem?
useEffecthook here:App/src/pages/workspace/WorkspaceInviteMessagePage.tsx
Lines 89 to 94 in 3047c1b
WorkspaceInvitePage.tsxwe need to clear the draft invite message when the component unmounts.App/src/pages/workspace/WorkspaceInvitePage.tsx
Lines 78 to 83 in 3047c1b
TO:
What alternative solutions did you explore? (Optional)
Result
Shahidullah-Muffakir commentedon Sep 29, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
when a user deletes the invite message in the workspace invite process, the message reappears unexpectedly.
What is the root cause of that problem?
The root cause of this problem is that the component was automatically resetting the welcome message to its default value, even when the user had intentionally deleted it
What changes do you think we should make in order to solve the problem?
we should update the useEffect to add a check that skips resetting the invite message if it is already empty. This ensures that when the user deletes the message, it doesn't get reset to the default value.
Add
!welcomeNotecheck here:App/src/pages/workspace/WorkspaceInviteMessagePage.tsx
Lines 89 to 92 in 3047c1b
to:
Screen.20Recording.202024-09-30.20at.203.mp4
huult commentedon Sep 30, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Invite message comes back after deleting it
What is the root cause of that problem?
Since we set
getDefaultWelcomeNoteas a dependency of this hook, the hook is triggered every time the input'sonChangeevent occursApp/src/pages/workspace/WorkspaceInviteMessagePage.tsx
Line 94 in 3634670
What changes do you think we should make in order to solve the problem?
We should remove
getDefaultWelcomeNotefrom the dependency array to avoid re-renders when the input changes.// .src/pages/workspace/WorkspaceInviteMessagePage.tsx#L94 useEffect(() => { if (isEmptyObject(invitedEmailsToAccountIDsDraft)) { return; } setWelcomeNote(getDefaultWelcomeNote()); - }, [getDefaultWelcomeNote, invitedEmailsToAccountIDsDraft]); + }, [invitedEmailsToAccountIDsDraft]);and We need to validate this input, if necessary, to avoid empty values ("")
// .src/pages/workspace/WorkspaceInviteMessagePage.tsx#L119 if (isEmptyObject(invitedEmailsToAccountIDsDraft)) { errorFields.welcomeMessage = translate('workspace.inviteMessage.inviteNoMembersError'); - } + } else if (isEmptyObject(welcomeNote)) { + errorFields.welcomeMessage = 'Please enter a welcome note.'; }Details
POCScreen.Recording.2024-09-30.at.09.24.15.mp4
Gonals commentedon Sep 30, 2024
Seems to be a frontend issue, so removing Web-E blocker
dangrous commentedon Sep 30, 2024
Yeah this was caused by PR #48660 and issue #34929 . We can just remove that new
useEffectbut I'm not sure what the point of it was originally, so pinged the PR authors. Thanks!rojiphil commentedon Sep 30, 2024
@dangrous Yeah. Fixing an eslint error (i.e. using useOnyx instead of withOnyx) during some last-minute changes caused this issue. I think we can consider this as a separate issue. Please assign me here as I have the context.
We need the second
useEffectto ensureworkspaceInviteMessageDraftis populated from the Onyx. However, an edge case got left out i.e. when the user intentionally deletes the entire welcome note in which case we should not reset.@Shahidullah-Muffakir proposal LGTM
62 remaining items
melvin-bot commentedon Oct 23, 2024
Current assignee @JmillsExpensify is eligible for the Bug assigner, not assigning anyone new.
tgolen commentedon Oct 23, 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:
rojiphil commentedon Oct 24, 2024
Steps:
rojiphil commentedon Oct 24, 2024
@tgolen BZ Checklist done
rojiphil commentedon Oct 26, 2024
@tgolen The payment step is completed as mentioned here.
Can we close this issue if nothing else is pending? Thanks.
tgolen commentedon Oct 28, 2024
Yep, we should be good here now. I'll close it out. Thanks!
tgolen commentedon Oct 28, 2024
Actually, I was wrong. @JmillsExpensify this needs a regression test created and I think that's your part of the checklist.
JmillsExpensify commentedon Oct 31, 2024
Test created and linked above, so closing this issue.