Skip to content
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

[Awaiting checklist completion] [$500] Workspace - Selected users to invite turn deselected when refresh Add message page #32839

Closed
3 of 6 tasks
kbecciv opened this issue Dec 11, 2023 · 35 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Dec 11, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.11-1
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Navigate to Settings> Workspace> Members> Invite
  3. Invite several more members
  4. Click on next to advance to the next page
  5. Add custom invite message
  6. Refresh the page
  7. Click on Back button to turn back to Invite members page

Expected Result:

Selected users to invite should remain after refreshing the page

Actual Result:

Selected users to invite turn deselected when refresh Add message page

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6309325_1702314309129.Recording__1528.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0126f4ea7df784a0b0
  • Upwork Job ID: 1734263366726746112
  • Last Price Increase: 2023-12-18
  • Automatic offers:
    • BhuvaneshPatil | Contributor | 28077747
Issue OwnerCurrent Issue Owner: @allroundexperts
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 11, 2023
@melvin-bot melvin-bot bot changed the title Workspace - Selected users to invite turn deselected when refresh Add message page [$500] Workspace - Selected users to invite turn deselected when refresh Add message page Dec 11, 2023
Copy link

melvin-bot bot commented Dec 11, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0126f4ea7df784a0b0

Copy link

melvin-bot bot commented Dec 11, 2023

Triggered auto assignment to @twisterdotcom (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 11, 2023
Copy link

melvin-bot bot commented Dec 11, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

Copy link

melvin-bot bot commented Dec 11, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts (External)

@BhuvaneshPatil
Copy link
Contributor

BhuvaneshPatil commented Dec 11, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Workspace - Selected users to invite turn deselected when refresh Add message page

What is the root cause of that problem?

We are using selectedOptions to store the invited users. That is being reset to empty [] when initialise.
When we refresh the page, it gets initialized to empty array.

What changes do you think we should make in order to solve the problem?

  • We store the users to invite ONYX object with key
    ${ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT}${policyID}
  • This contains the dictionary as {login: accountID}.
Screenshot 2023-12-12 at 12 56 03 AM

We can use these logins to populate selectedOptions state in useEffect of WorkspaceInvitePage.
For example if we store value from ONYX in invitedUsersDraft props.
We can populate this newSelectedOptions(line 107) like following

_.each(_.keys(props.invitedUsersDraft), (login) => {
         newSelectedOptions.push(_.has(detailsMap, login) ? {...detailsMap[login], isSelected: true} : inviteOptions[login]);
     });

This will do the work.

Screen.Recording.2023-12-12.at.1.00.01.AM.mov

Question that I have is - what to do if we go back to previous page and come again back to invite page, the options will remain as is.
Observe when we go back from invite page to members page and click next, options are pre-populated.

Screen.Recording.2023-12-12.at.1.03.09.AM.mov

Shall we erase the options?
If yes - Then we can just call setWorkspaceInviteMembersDraft with empty object when we press back.
Or we can call above method in clean up of useEffect with [] dependency.

As called out in this proposal, about changing the WORKSPACE_INVITE_MEMBERS_DRAFT when use clicks the option, we can handle that by taking out all logic(except navigation) of inviteUser() and call that.

What alternative solutions did you explore? (Optional)

@BhuvaneshPatil
Copy link
Contributor

BhuvaneshPatil commented Dec 11, 2023

@twisterdotcom I have asked a question in my proposal

Question that I have is - what to do if we go back to previous page and come again back to invite page, the options will remain as is.

Please have a look and suggest the expected behaviour.
Thanks

@DylanDylann
Copy link
Contributor

DylanDylann commented Dec 13, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Selected users to invite turn deselected when refresh Add message page

What is the root cause of that problem?

The selected option is set to empty when reloading the page

What changes do you think we should make in order to solve the problem?

Currently, On the Invite Member Page, if the user clicks the next button we will save the selected option to WORKSPACE_INVITE_MEMBERS_DRAFT. So we can use this field to re-set the selected option on the Invite Member Page

In this useEffect we also need to add WORKSPACE_INVITE_MEMBERS_DRAFT to newSelectedOption

We also need to add more logic to update WORKSPACE_INVITE_MEMBERS_DRAFT:

  1. when the user selects or unselects a new option, we need to update WORKSPACE_INVITE_MEMBERS_DRAFT. So that when the user reload the page the newly selected option will be updated
  2. Reset WORKSPACE_INVITE_MEMBERS_DRAFT to empty when the Invite Member Page is unmount by using clean up function of useEffect
  3. In here

We also need to add logic to reset WORKSPACE_INVITE_MEMBERS_DRAFT to empty like we did with search input value

What alternative solutions did you explore? (Optional)

NA

@melvin-bot melvin-bot bot added the Overdue label Dec 14, 2023
@twisterdotcom
Copy link
Contributor

what to do if we go back to previous page and come again back to invite page

I think it's fine for the previously selected invitees to still be selected here. I don't see why we need to clear them.

@melvin-bot melvin-bot bot removed the Overdue label Dec 15, 2023
@twisterdotcom
Copy link
Contributor

@allroundexperts how are these proposals?

Copy link

melvin-bot bot commented Dec 18, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Dec 18, 2023
Copy link

melvin-bot bot commented Dec 18, 2023

@twisterdotcom, @allroundexperts Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Dec 18, 2023

@twisterdotcom, @allroundexperts Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@twisterdotcom
Copy link
Contributor

@Sourcecodedeveloper I'm down to do the easiest solution, so starting fresh is also fine.

@aimane-chnaif
Copy link
Contributor

#32835 is similar to this one

@allroundexperts
Copy link
Contributor

@BhuvaneshPatil's proposal looks good to me. @Sourcecodedeveloper I don't see any good reason to use fallbackRoute when we are already saving the draft state of the workspace in Onyx.

@DylanDylann Thanks for your proposal. However, I don't really see any significant difference from what @BhuvaneshPatil proposed earlier.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Dec 20, 2023

Triggered auto assignment to @cristipaval, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@DylanDylann
Copy link
Contributor

@allroundexperts the significant difference between my proposal and @BhuvaneshPatil's proposal is how we update WORKSPACE_INVITE_MEMBERS_DRAFT. At the time I posted the proposal, he didn't mention any way to do that

Copy link

melvin-bot bot commented Dec 28, 2023

@twisterdotcom, @cristipaval, @allroundexperts Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Copy link

melvin-bot bot commented Jan 1, 2024

@twisterdotcom @cristipaval @allroundexperts this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

Copy link

melvin-bot bot commented Jan 1, 2024

@twisterdotcom @cristipaval @allroundexperts this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

@twisterdotcom
Copy link
Contributor

Bump on this @cristipaval

@melvin-bot melvin-bot bot removed the Overdue label Jan 2, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 2, 2024
Copy link

melvin-bot bot commented Jan 2, 2024

📣 @BhuvaneshPatil 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@cristipaval
Copy link
Contributor

cristipaval commented Jan 2, 2024

what to do if we go back to previous page and come again back to invite page

I think it's fine for the previously selected invitees to still be selected here. I don't see why we need to clear them.

If the user explicitly leaves the page, I think we should start with a fresh list when they come back 🤔
cc @twisterdotcom

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jan 5, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jan 18, 2024
@melvin-bot melvin-bot bot changed the title [$500] Workspace - Selected users to invite turn deselected when refresh Add message page [HOLD for payment 2024-01-25] [$500] Workspace - Selected users to invite turn deselected when refresh Add message page Jan 18, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 18, 2024
Copy link

melvin-bot bot commented Jan 18, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Jan 18, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.26-2 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-01-25. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jan 18, 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:

  • [@allroundexperts] The PR that introduced the bug has been identified. Link to the PR:
  • [@allroundexperts] 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:
  • [@allroundexperts] 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:
  • [@allroundexperts] Determine if we should create a regression test for this bug.
  • [@allroundexperts] 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.
  • [@twisterdotcom] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@twisterdotcom
Copy link
Contributor

Payment Summary:

@twisterdotcom twisterdotcom added Awaiting Payment Auto-added when associated PR is deployed to production and removed Awaiting Payment Auto-added when associated PR is deployed to production labels Jan 25, 2024
@twisterdotcom twisterdotcom changed the title [HOLD for payment 2024-01-25] [$500] Workspace - Selected users to invite turn deselected when refresh Add message page [Awaiting checklist completion] [$500] Workspace - Selected users to invite turn deselected when refresh Add message page Jan 25, 2024
@allroundexperts
Copy link
Contributor

Checklist

  1. I think this was more of a feature than a bug. As such, there isn't any PR that is responsible for introducing this.
  2. N/A
  3. N/A
  4. A regression test would be good though. The steps given in the OP seem clear enough to me.

@JmillsExpensify
Copy link

$500 payment approved for @twisterdotcom based on this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants