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

[HOLD for payment 2023-06-08] [$1000] Error appears for a second when user select new member as Assignee #19203

Closed
1 of 6 tasks
kavimuru opened this issue May 18, 2023 · 25 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kavimuru
Copy link

kavimuru commented May 18, 2023

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


Action Performed:

  1. click + button
  2. select Assign task option
  3. Enter tittle and click on Next button
  4. click on Assignee option
  5. search for new member which is not in list
  6. select that member

Expected Result:

Error appears for a second on Confirm task page

Actual Result:

should not show any error

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.16-3
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-05-16.at.6.59.12.PM.mov
Recording.644.mp4

Expensify/Expensify Issue URL:
Issue reported by: @gadhiyamanan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1684243797708189

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0112661f5cf190cf47
  • Upwork Job ID: 1660712581755756544
  • Last Price Increase: 2023-05-22
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 18, 2023

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

@melvin-bot
Copy link

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

@dukenv0307
Copy link
Contributor

dukenv0307 commented May 19, 2023

Proposal

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

Error appears for a second when user select new member as Assignee

What is the root cause of that problem?

If the assignee is new member, props.personalDetails will not have detail information of that member until API openReport that is called in setAssigneeValue returns data

function setAssigneeValue(assignee, shareDestination) {
let newChat = {};
const chat = ReportUtils.getChatByParticipants([assignee]);
if (!chat) {
newChat = ReportUtils.buildOptimisticChatReport([assignee]);
}
const reportID = chat ? chat.reportID : newChat.reportID;
if (!shareDestination) {
setShareDestinationValue(reportID);
}
Report.openReport(reportID, [assignee], newChat);
// This is only needed for creation of a new task and so it should only be stored locally
Onyx.merge(ONYXKEYS.TASK, {assignee});
}

So that before API openReport returns data, assigneeDetails is undefined and the error appears. Thus, this issue occurs
if (props.task.assignee) {
const assigneeDetails = lodashGet(props.personalDetails, props.task.assignee);
if (!assigneeDetails) {
setSubmitError(true);
return setErrorMessage(props.translate('newTaskPage.assigneeError'));
}
const displayDetails = TaskUtils.getAssignee(assigneeDetails);
setAssignee(displayDetails);
}

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

  • Case 1
    If It is expected that we can assign a task for a new member that doesn't exist in personalDetails before, we could get assigneeDetails by replacing props.personalDetails in here by
OptionsListUtils.getPersonalDetailsForLogins([props.task.assignee], props.personalDetails)

to create a temporary personalDetail for this new member instead of getting directly from props.personalDetails. We are doing the same thing on the request money page

  • Case 2
    if it's expected to show an error when assigning tasks for a new member (who doesn't exist in personalDetail), we should add check if (chat) in here to prevent calling openReport if assignee is new member.
    Report.openReport(reportID, [assignee], newChat);

What alternative solutions did you explore? (Optional)

@sakluger
Copy link
Contributor

I was able to reproduce this error. I also discussed in Slack with @thienlnam here (https://expensify.slack.com/archives/C04QEB4MJEQ/p1684539286006029). I think that this is happening when you assign a task to someone who isn't in the current DM/room you are in.

Asked Jack if this should be internal or external, just waiting for that answer before moving this forward.

@thienlnam thienlnam added the External Added to denote the issue can be worked on by a contributor label May 22, 2023
@melvin-bot melvin-bot bot changed the title Error appears for a second when user select new member as Assignee [$1000] Error appears for a second when user select new member as Assignee May 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0112661f5cf190cf47

@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

Triggered auto assignment to @slafortune (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@thienlnam
Copy link
Contributor

Adding external so we can get some investigation on how to moveforward

@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

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

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

melvin-bot bot commented May 22, 2023

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

@sakluger
Copy link
Contributor

Not sure why @slafortune was assigned since I'm already assigned as the BugZero member. Removing her assignment.

@sobitneupane
Copy link
Contributor

Thanks for the proposal @dukenv0307.

const assigneeDetails = lodashGet(props.personalDetails, props.task.assignee);
if (!assigneeDetails) {
setSubmitError(true);
return setErrorMessage(props.translate('newTaskPage.assigneeError'));
}

  • Even though error is displayed, user are allowed to "Confirm task" which should not be the case.

  • User won't be able to assign task to new user in offline if user has to wait for api response for personal details.

Based on the above points, I don't think we want to block to assign task to a new user.

Proposal from @dukenv0307 to use OptionsListUtils.getPersonalDetailsForLogins looks good.

🎀👀🎀 C+ reviewed
cc: @jasperhuangg

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

melvin-bot bot commented May 29, 2023

📣 @dukenv0307 You have been assigned to this job by @jasperhuangg!
Please apply to this job in Upwork 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 📖

@jasperhuangg
Copy link
Contributor

agree! let's go with their proposal, thanks!

@melvin-bot melvin-bot bot removed the Overdue label May 29, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jun 1, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Error appears for a second when user select new member as Assignee [HOLD for payment 2023-06-08] [$1000] Error appears for a second when user select new member as Assignee Jun 1, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 1, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 1, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.21-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 2023-06-08. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jun 1, 2023

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:

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

@sakluger
Copy link
Contributor

sakluger commented Jun 4, 2023

Paid for the bug report. I'll be OOO on 6/8 when we need to pay everyone else, so I'm going to assign another BZ team member to complete payment.

@sobitneupane can you please make sure to complete the BugZero checklist between now and then? Thanks!

@sakluger sakluger removed their assignment Jun 4, 2023
@sakluger sakluger added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Jun 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 4, 2023

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 4, 2023
@Expensify Expensify deleted a comment from melvin-bot bot Jun 4, 2023
@sakluger sakluger self-assigned this Jun 4, 2023
@melvin-bot melvin-bot bot added the Overdue label Jun 6, 2023
@tjferriss
Copy link
Contributor

tjferriss commented Jun 7, 2023

On track to pay in a couple days. @sobitneupane can you help with the checklist?

@melvin-bot melvin-bot bot added Daily KSv2 and removed Overdue Daily KSv2 labels Jun 7, 2023
@sobitneupane
Copy link
Contributor

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:

  • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:

#17992

  • [@sobitneupane] 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:

#17992 (comment)

  • [@sobitneupane] 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:

I don't think any change in checklist is required. It should have been caught in offline test.

  • [@sobitneupane] Determine if we should create a regression test for this bug.

yes

@sobitneupane
Copy link
Contributor

Regression Test Proposal

  1. Go to FAB > Assign Task > Enter title and description and navigate to next page
  2. Click on Assignee and enter a new account which is not used anywhere yet
  3. Verify that the assignee is added immediately and no error appears

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Jun 12, 2023
@tjferriss
Copy link
Contributor

Payments have been sent including the 50% speed bonus. I've created the regression test issue for Applause.

@melvin-bot melvin-bot bot removed the Overdue label Jun 12, 2023
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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants