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-11-13] [$500] Task needs revisit to update members #29228

Closed
5 of 6 tasks
m-natarajan opened this issue Oct 10, 2023 · 34 comments
Closed
5 of 6 tasks
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 External Added to denote the issue can be worked on by a contributor

Comments

@m-natarajan
Copy link

m-natarajan commented Oct 10, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.3.80-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: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696942077360429

Action Performed:

  1. Open the app
  2. Open any task report or raise one and open the report
  3. Click on task header -> members to observe current members
  4. Again get back to report and change assignee to any non member user
  5. Again click on task header -> members and observe that new assignee is not added to members
  6. Revisit report and observe members, it will now display new assignee in members

Expected Result:

App should add new assignee to members as soon as we change the assignee

Actual Result:

App needs revisit to report to add new assignee to members

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

Android: Native
Android: mWeb Chrome
android.chrome.revisit.needed.to.update.members.mp4
iOS: Native
ios.native.revisit.needed.to.update.members.mov
iOS: mWeb Safari
ios.safari.revisit.needed.to.update.members.mov
MacOS: Chrome / Safari
mac.chrome.revisit.needed.to.update.members.mov
windows.chrome.revisit.needed.to.update.members.mp4
Recording.39.mp4
MacOS: Desktop
mac.desktop.revisit.needed.to.update.members.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01609c654d88438959
  • Upwork Job ID: 1711835475398246400
  • Last Price Increase: 2023-10-24
  • Automatic offers:
    • cubuspl42 | Reviewer | 27439450
    • Tony-MK | Contributor | 27439452
    • dhanashree-sawant | Reporter | 27439455
@m-natarajan m-natarajan 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 Oct 10, 2023
@melvin-bot melvin-bot bot changed the title Task needs revisit to update members [$500] Task needs revisit to update members Oct 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01609c654d88438959

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

melvin-bot bot commented Oct 10, 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
Copy link

melvin-bot bot commented Oct 10, 2023

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

@akamefi202
Copy link
Contributor

I'm not able to reproduce this issue.
In step 3, it shows profile page instead of task details page when the user clicks the header of task.
Is this bug or expected behavior?

@melvin-bot melvin-bot bot added the Overdue label Oct 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

@cubuspl42, @stephanieelliott Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

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

@stephanieelliott
Copy link
Contributor

I'm not able to reproduce this issue.
In step 3, it shows profile page instead of task details page when the user clicks the header of task.
Is this bug or expected behavior?

I'm seeing the same thing as @akamefi202. @dhanashree-sawant can you expand on the repro steps? Or are there specific settings on the task that needs to be set in order to repro this?

@melvin-bot melvin-bot bot removed the Overdue label Oct 18, 2023
@dhanashree-sawant
Copy link

I saw the same issue when creating new task i.e. it displayed user profile (seems to be different bug). What I did was I changed the assignee to someone else and revisited. After that it started displaying members and settings option in details page.

@melvin-bot melvin-bot bot added the Overdue label Oct 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

@cubuspl42, @stephanieelliott Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot
Copy link

melvin-bot bot commented Oct 24, 2023

@cubuspl42 @stephanieelliott this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot
Copy link

melvin-bot bot commented Oct 24, 2023

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

@stephanieelliott
Copy link
Contributor

still waiting for proposals

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 25, 2023
@Tony-MK
Copy link
Contributor

Tony-MK commented Oct 28, 2023

Proposal

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

Task needs revisit to update members.

What is the root cause of that problem?

The ReportParticipantsPage uses the ReportUtils.getParticipantsIDs function to get the account ids stored in the report.participantAccountIDs array and display the current list of members.

const getAllParticipants = (report, personalDetails, translate) =>
_.chain(ReportUtils.getParticipantsIDs(report))

App/src/libs/ReportUtils.js

Lines 4028 to 4033 in a59d56f

function getParticipantsIDs(report) {
if (!report) {
return [];
}
const participants = report.participantAccountIDs || [];

Hence, the root cause of the problem is that if the user changes the task assignee, the Task.editTaskAssigneeAndNavigate function assumes that command=openReport will be processed and report.participantAccountIDs will be updated .

However, this is not the case. Unless the user closes and revisits the task report, then the command=openReport request will be processed, hence updating the report.participantAccountIDs.

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

In order to solve the problem, I suggest updating the report.participantAccountIDs array instead of waiting on command=openReport. This will allow the new assignee to be updated in the ReportParticipantsPage before the server updates the task report data. As an added advantage, the ReportParticipantsPage can display the recently added members regardless of any user's internet connection. This is due to the fact that the ReportParticipantsPage will list new assignees immediately without having to wait for the report's data to be updated by the server.

// If we make a change to the assignee, we want to add a comment to the assignee's chat
// Check if the assignee actually changed
if (assigneeAccountID && assigneeAccountID !== report.managerID && assigneeAccountID !== ownerAccountID && assigneeChatReport) {

Therefore, I believe adding something similar to the code below inside the condition above, located in Task.editTaskAssigneeAndNavigate, should solve the problem. The condition above is only true when the assignee actually changes. Read the two comments before the condition.

const participants = lodashGet(report, 'participantAccountIDs', []);
if (!participants.include(assigneeAccountID)) optimisticData[1].value.participantAccountIDs = [...participants, assigneeAccountID];

The code above adds participantAccountIDs : [...report.participantAccountIDs, assigneeAccountID] to the value second item in the optimisticData array. This happens only when the report.participantAccountIDs does not contain the account ID of the new assignee (assigneeAccountID).

@cubuspl42
Copy link
Contributor

@Tony-MK

will be updated . very

Are we missing a sentence here, or is it just an extra word left in the proposal by accident?

@melvin-bot melvin-bot bot removed the Overdue label Oct 30, 2023
@Tony-MK
Copy link
Contributor

Tony-MK commented Oct 30, 2023

@Tony-MK

will be updated . very

Are we missing a sentence here, or is it just an extra word left in the proposal by accident?

@cubuspl42 Sorry about that. It was an extra word left out while trying to edit the proposal.

@cubuspl42
Copy link
Contributor

In my opinion, the proposal by @Tony-MK sounds reasonable. I agree that the suggested change will also improve the offline experience. I think we should proceed with @Tony-MK.

C+ reviewed 🎀 👀 🎀

@melvin-bot
Copy link

melvin-bot bot commented Oct 31, 2023

@cubuspl42 @luacmartins @Tony-MK @stephanieelliott 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!

@stephanieelliott
Copy link
Contributor

Disregard Melvin message above, this one is awaiting PR from @Tony-MK

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 1, 2023
@Tony-MK
Copy link
Contributor

Tony-MK commented Nov 1, 2023

Hey @cubuspl42, I have created a PR. Could you kindly find some time to review it?
Thank you 😃

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@stephanieelliott
Copy link
Contributor

PR deployed to staging on 11/2

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 6, 2023
@melvin-bot melvin-bot bot changed the title [$500] Task needs revisit to update members [HOLD for payment 2023-11-13] [$500] Task needs revisit to update members Nov 6, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 6, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

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

Copy link

melvin-bot bot commented Nov 6, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.95-9 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-11-13. 🎊

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:

Copy link

melvin-bot bot commented Nov 6, 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:

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 Daily KSv2 labels Nov 13, 2023
@stephanieelliott
Copy link
Contributor

Hey @cubuspl42 can you complete the BZ checklist please?

@cubuspl42
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR:
    • It seems that the bug was present in the relevant components since they were created
  • 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:
    • N/A
  • 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:
    • No need for additional discussion
  • Determine if we should create a regression test for this bug.
    • Up to the QA team
  • 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.
    • Create a task.
    • Assign the task to an account other than your own.
    • Click on the task header.
    • Confirm that the assignee is listed.
    • Reassign the task to a yet another account (not yours or the one previously selected).
    • Click the task report header again.
    • Ensure that the member count has incremented by one.
    • Confirm that the members list now includes the newly assigned member.

@melvin-bot melvin-bot bot added the Overdue label Nov 20, 2023
@stephanieelliott
Copy link
Contributor

Summarizing payment on this issue:

Upwork job is here, no bonus is included on payout

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 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants