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-08-02] [$1000] Web - Task Assignment Anomaly: Auto-Generated Content with unexpected character and Random Avatar in "Share Somewhere" Field of Task Assignment #22433

Closed
6 tasks
kbecciv opened this issue Jul 7, 2023 · 32 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

@kbecciv
Copy link

kbecciv commented Jul 7, 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 on + button and assign a task
  2. Fill title and description
  3. Choose an assignee for the contact list (Eg-try- [email protected])
  4. Verify if a random character appears at the share somewhere field automatically.
  5. Try changing the assignee and verify the auto generated field in share somewhere is still there
  6. Click on + button again and try with another contact and verify what different character appeared this time

Expected Result:

There should be no auto-generated characters.

Actual Result:

Upon selecting an assignee, a random character (e.g., '2' or 's') and an avatar of a random user from the contact list appeared in the "Share Somewhere" field.

Workaround:

Unknown

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.37-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

Recording.3478.mp4
share.somewhere.bug.mp4

Expensify/Expensify Issue URL:
Issue reported by: @avi-shek-jha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688668409161139

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01394f0903ab2984cf
  • Upwork Job ID: 1681882986008707072
  • Last Price Increase: 2023-07-20
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 7, 2023

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

@melvin-bot
Copy link

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

@bernhardoj
Copy link
Contributor

Proposal

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

When selecting an assignee, the Share somewhere autofill with wrong report.

What is the root cause of that problem?

When we select an assignee for the first time, it will autofill the Share somewhere for you by taking the assignee accountID and then searching in all reports that have the exact same accountID.

const chat = ReportUtils.getChatByParticipants([newAssigneeAccountID]);
if (!chat) {
newChat = ReportUtils.buildOptimisticChatReport([newAssigneeAccountID]);
}
const reportID = chat ? chat.reportID : newChat.reportID;
if (!shareDestination) {
setShareDestinationValue(reportID);
}

The problem lies in getChatByParticipants.

App/src/libs/ReportUtils.js

Lines 2117 to 2125 in 60f4817

return _.find(allReports, (report) => {
// If the report has been deleted, or there are no participants (like an empty #admins room) then skip it
if (!report || !report.participantAccountIDs || isChatThread(report)) {
return false;
}
// Only return the room if it has all the participants and is not a policy room
return !isUserCreatedPolicyRoom(report) && _.isEqual(newParticipantList, _.sortBy(report.participantAccountIDs));
});

It iterates over all report (😱) and compares the participantAccountIDs array. It will find the first occurrences that have the same participantAccountIDs array. Currently, it ignores a thread report and policy room report (isUserCreatedPolicyRoom). However, there is some report that potentially has the same participantAccountIDs, for example, task report.

If you assign user A to the task, the task report participantAccountIDs will be [userAId]. This means, now we have 2 reports with the same participantAccountIDs. The normal (1:1) chat and the task report. In case the task report has a smaller ID than the 1:1 chat (it's important because report onyx is sorted by id), getChatByParticipants will return the task report. So, the "Share somewhere" field is auto-filled by the task report instead of the 1:1 chat.

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

We should add some exclusion to other reports.

if (... || isTaskReport(report) || isMoneyRequestReport(report) || isChatRoom(report) || isPolicyExpenseChat(report)) return;

This will fix everything that depends on this function, e.g. request, split money, etc.

@melvin-bot
Copy link

melvin-bot bot commented Jul 10, 2023

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

@mallenexpensify
Copy link
Contributor

@kadiealexander , @bernhardoj thinks this issue might be the same root case as

Not sure if it's best to put one on hold or not

@kadiealexander
Copy link
Contributor

@abdulrahuman5196 I'd love your thoughts on whether this will be fixed with the same fix, if so I'll place this on hold.

@melvin-bot melvin-bot bot removed the Overdue label Jul 11, 2023
@abdulrahuman5196
Copy link
Contributor

Hi, Will check and update if we should put this on hold tomorrow morning

@melvin-bot melvin-bot bot added the Overdue label Jul 13, 2023
@abdulrahuman5196
Copy link
Contributor

@kadiealexander I think it is related from the proposal from @bernhardoj. I will review the proposal there and re-check if the solution solves both the issues and update back here.

@melvin-bot
Copy link

melvin-bot bot commented Jul 14, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 18, 2023

@kadiealexander 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@kadiealexander
Copy link
Contributor

@abdulrahuman5196 thoughts on placing this on hold?

@melvin-bot melvin-bot bot removed the Overdue label Jul 19, 2023
@abdulrahuman5196
Copy link
Contributor

@kadiealexander I did a dive deep on the other issue, and seems the proposal by @bernhardoj here doesn't solve the other issue as far as reviewed now #22031 (comment) .

But meanwhile i also check the same proposal here #22433 (comment) by @bernhardoj . It solves this issue and root cause is correct. I am gettings tasks included in the getChatByParticipants find function.

Since I had already review this proposal, if possible could you assign me C+ for this issue? I can verify again and approve the proposal.

@kadiealexander kadiealexander added the External Added to denote the issue can be worked on by a contributor label Jul 20, 2023
@melvin-bot melvin-bot bot changed the title Web - Task Assignment Anomaly: Auto-Generated Content with unexpected character and Random Avatar in "Share Somewhere" Field of Task Assignment [$1000] Web - Task Assignment Anomaly: Auto-Generated Content with unexpected character and Random Avatar in "Share Somewhere" Field of Task Assignment Jul 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01394f0903ab2984cf

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

melvin-bot bot commented Jul 20, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 20, 2023
@abdulrahuman5196
Copy link
Contributor

And @bernhardoj For me i only had task with the same participants list, which worked with || isTaskReport(report) alone, During PR kindly verify adding other types of report check doesn't cause any regression.

On @bernhardoj 's proposal here, the changes looks good and works well. Root cause is also correct.
Note: It is not random content on the share somewhere, but some other task name which had same participants list was shown.

🎀 👀 🎀
C+ Reviewed

@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

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

@abdulrahuman5196
Copy link
Contributor

@robertjchen C+ approved proposal is here #22433 (comment)

@robertjchen
Copy link
Contributor

Yep, agreed with solution in adding exclusions for report types and I also second @abdulrahuman5196 's comment on verifying that we don't cause any regressions given that getChatByParticipants is used in multiple places 👀

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

melvin-bot bot commented Jul 20, 2023

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

Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

📣 @bernhardoj You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

📣 @avi-shek-jha 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Upwork job

@bernhardoj
Copy link
Contributor

Will open the PR tomorrow

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jul 21, 2023
@bernhardoj
Copy link
Contributor

PR is up

cc: @abdulrahuman5196

@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 2023

🎯 ⚡️ Woah @abdulrahuman5196 / @bernhardoj, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @bernhardoj got assigned: 2023-07-20 14:35:28 Z
  • when the PR got merged: 2023-07-24 04:37:22 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 26, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - Task Assignment Anomaly: Auto-Generated Content with unexpected character and Random Avatar in "Share Somewhere" Field of Task Assignment [HOLD for payment 2023-08-02] [$1000] Web - Task Assignment Anomaly: Auto-Generated Content with unexpected character and Random Avatar in "Share Somewhere" Field of Task Assignment Jul 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 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 Jul 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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

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 Jul 26, 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: n/a
  • [@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: n/a
  • [@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: n/a
  • [@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.
  • [@kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/305209

@abdulrahuman5196
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR:
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:

Not a regression. This seem to have been the case from task implementation itself.

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. Open Assign Task
  2. Enter any title and go next
  3. Open the assignee page
  4. Select user B
  5. Verify Share somewhere shows user B

@kadiealexander

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Aug 1, 2023
@kadiealexander
Copy link
Contributor

kadiealexander commented Aug 3, 2023

Payouts due:

Eligible for 50% #urgency bonus? Yes

Bug0 Checklist: #22433 (comment)

Upwork job is here.

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

7 participants