Skip to content

[HOLD for payment 2023-10-16] [$500] Assign Task - Assignee field active in offline mode while assigning task, should be greyed out #25956

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

Closed
1 of 6 tasks
lanitochka17 opened this issue Aug 25, 2023 · 56 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 Engineering Internal Requires API changes or must be handled by Expensify staff

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 25, 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. Open a chat
  2. Navigate to the "Assign task" section
  3. Create a task by entering a title
  4. Enable offline mode from Preferences
  5. Select a user from the assignee field
  6. Notice assignee field is not greyed out

Expected Result:

During offline mode, the assignee field should appear greyed out to indicate its inactivity while assigning a task

Actual Result:

The assignee field remains active and doesn't turn grey while assigning a task in offline mode

Workaround:

Unknown

Platforms:

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

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

Version Number: 1.3.57-4

Reproducible in staging?: Yes

Reproducible in production?: Yes

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-08-12-at-31853-am_RnxP47TY.1.mp4
Gravar.2977.mp4

Expensify/Expensify Issue URL:

Issue reported by: @ayazhussain79

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691792826667939

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01cb180f9f96ed4319
  • Upwork Job ID: 1697586364732370944
  • Last Price Increase: 2023-09-15
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 25, 2023
@DylanDylann
Copy link
Contributor

Proposal

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

Assignee field active in offline mode while assigning task, should be greyed out

What is the root cause of that problem?

We don't set pendingField when editing assignee

function editTaskAssigneeAndNavigate(report, ownerAccountID, assigneeEmail, assigneeAccountID = 0, assigneeChatReport = null) {

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

In optimistic report data

onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`,
value: {
reportName,
managerID: assigneeAccountID || report.managerID,
managerEmail: assigneeEmail || report.managerEmail,

we should add pending field managerID: update like this

pendingFields: {
        ...(assigneeAccountID && {managerID: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}),
},

We also need to remove pendingFields when updating successful

What alternative solutions did you explore? (Optional)

@esh-g
Copy link
Contributor

esh-g commented Aug 25, 2023

Proposal

Please re-state the problem we are trying to solve

The task assignee field is doesn't get greyed out when changed offline.

What is the root cause of this problem?

This was introduced in this PR: #22778
We are not setting the pendingField for managerID while editing task assignee in optimistic data

{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`,
value: {
reportName,
managerID: assigneeAccountID || report.managerID,
managerEmail: assigneeEmail || report.managerEmail,
},
},
];

Therefore, the pending field for managerID is always null and it never gets greyed out.

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

  1. We should add the pendingField to the optimistic data while editing task assignee like this:
{
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`,
    value: {
        reportName,
        managerID: assigneeAccountID || report.managerID,
        managerEmail: assigneeEmail || report.managerEmail,
        pendingFields: {managerID: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}, // add this line
    },
},
  1. In success data, we should add the following to clear out the pending fields
{
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`,
    value: {pendingFields: {managerID: null}}
}

This is the same approach we follow editTaskAndNavigate function.

@melvin-bot
Copy link

melvin-bot bot commented Aug 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 25, 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

@melvin-bot melvin-bot bot added the Overdue label Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

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

@michaelhaxhiu
Copy link
Contributor

@allroundexperts - do you think this bug report & problem is a dupe of #23200? Would love your input!

@melvin-bot melvin-bot bot removed the Overdue label Aug 30, 2023
@michaelhaxhiu
Copy link
Contributor

Yep this feels and looks like a dupe, and the other GH is addressing it. Closing.

@ayazhussain79
Copy link
Contributor

@michaelhaxhiu This bug #23200 PR merged but #25956 is still reproducible @allroundexperts can you please also check this one

@michaelhaxhiu
Copy link
Contributor

Hmm let's see what's suggested on #23200 from those involved. You may be due a bug reporting bounty if this is indeed "separate" and thus unique.

@michaelhaxhiu
Copy link
Contributor

But firstly I want to ensure this is fixed. If it's not fixed, there is no bug bounty to pay. That's the pre-requisite.

@michaelhaxhiu
Copy link
Contributor

#22778 (comment)

Commented here for team input on how to best proceed. This is a valid bug and still occurring based on latest testing, so we do need to fix it. But I want to check if we should draft a new PR or amend/update the PR that caused it.

@michaelhaxhiu michaelhaxhiu added the External Added to denote the issue can be worked on by a contributor label Sep 1, 2023
@melvin-bot melvin-bot bot changed the title Assign Task - Assignee field active in offline mode while assigning task, should be greyed out [$500] Assign Task - Assignee field active in offline mode while assigning task, should be greyed out Sep 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 1, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01cb180f9f96ed4319

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

melvin-bot bot commented Sep 1, 2023

Current assignee @michaelhaxhiu is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Sep 1, 2023

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

@michaelhaxhiu
Copy link
Contributor

cc'ing
@thienlnam
@Santhosh-Sellavel

@michaelhaxhiu
Copy link
Contributor

this is a regression from #22778

@michaelhaxhiu
Copy link
Contributor

might make sense for @abdulrahuman5196 to trade this GH to @Santhosh-Sellavel since he was involved in the parent regression, though it's not necessary. I'll let yall decide.

@abdulrahuman5196
Copy link
Contributor

abdulrahuman5196 commented Oct 2, 2023

Pending on @tylerkaraszewski review.

@DylanDylann
Copy link
Contributor

@abdulrahuman5196 The PR is ready for review: #28378

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 9, 2023
@melvin-bot melvin-bot bot changed the title [$500] Assign Task - Assignee field active in offline mode while assigning task, should be greyed out [HOLD for payment 2023-10-16] [$500] Assign Task - Assignee field active in offline mode while assigning task, should be greyed out Oct 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.79-5 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-10-16. 🎊

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

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

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 Oct 9, 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:

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

@abekkala
Copy link
Contributor

abekkala commented Oct 10, 2023

PAYMENTS FOR OCT 16

@DylanDylann
Copy link
Contributor

DylanDylann commented Oct 10, 2023

@abekkala Could you help to check the timeline bonus again? The PR is merged in 3 days

@abdulrahuman5196
Copy link
Contributor

@abekkala Could you help to check the timeline bonus again? The PR is merged in 3 days

Yes. PR was merged within 3 days. Melvin missed here.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 Daily KSv2 labels Oct 16, 2023
@abekkala
Copy link
Contributor

@DylanDylann and @abdulrahuman5196 ah, yes - I do see that Melvin missed this one.

@abdulrahuman5196 please complete checklist prior to payment

@abdulrahuman5196
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR:

https://github.com/Expensify/App/pull/22778/files

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:
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:

https://github.com/Expensify/App/pull/22778/files#r1361115083

Determine if we should create a regression test for this bug.

Yes.

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.

  1. Create a task
  2. Enable offline mode from Preferences
  3. Update the task assignee
  4. Verify assignee field is greyed out
  5. Disable offline mode from Preferences
  6. Verify all field is updated

@abekkala

@abekkala
Copy link
Contributor

@ayazhussain79 paid and contract ended - thank you! 🎉

@DylanDylann paid and contract ended - thank you! 🎉

@abdulrahuman5196 paid and contract ended - thank you! 🎉

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 Engineering Internal Requires API changes or must be handled by Expensify staff
Projects
None yet
Development

No branches or pull requests

10 participants