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-10-18] [$1000] Web - Reaction does not show on immediately other side #27536

Closed
1 of 6 tasks
kbecciv opened this issue Sep 15, 2023 · 43 comments
Closed
1 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 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Sep 15, 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!


Action Performed:

  1. Open chat with userB
  2. Send any message
  3. Hover on message and select reply in thread option
  4. Go to thread report screen
  5. Add a reaction to message

Expected Result:

Reaction should show on receiver side

Actual Result:

Reaction does not show on receiver side

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.70.5
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-09-04.at.4.19.48.PM.mov
Recording.4493.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01685af985dafa883e
  • Upwork Job ID: 1702691981377064960
  • Last Price Increase: 2023-10-03
  • Automatic offers:
    • 0xmiroslav | Reviewer | 27014480
    • paultsimura | Contributor | 27014481
    • gadhiyamanan | Reporter | 27014483
@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 Sep 15, 2023
@melvin-bot melvin-bot bot changed the title Web - Reaction does not show on immediately other side [$500] Web - Reaction does not show on immediately other side Sep 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01685af985dafa883e

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

melvin-bot bot commented Sep 15, 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 Sep 15, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

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

@TheyCallMeCheng
Copy link

Has this been solved already? I cannot reproduce on my machine/works as intended

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

📣 @TheyCallMeCheng! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@paultsimura
Copy link
Contributor

paultsimura commented Sep 15, 2023

Proposal

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

When reacting to a message in a thread, the reaction is not updated on the recipient's end.

What is the root cause of that problem?

In this function we incorrectly handled the emoji reaction in the thread:

App/src/libs/actions/Report.js

Lines 1781 to 1803 in b8791c3

function toggleEmojiReaction(reportID, reportAction, reactionObject, existingReactions, paramSkinTone = preferredSkinTone) {
const originalReportID = ReportUtils.getOriginalReportID(reportID, reportAction);
const originalReportAction = ReportActionsUtils.getReportAction(originalReportID, reportAction.reportActionID);
if (_.isEmpty(originalReportAction)) {
return;
}
// This will get cleaned up as part of https://github.com/Expensify/App/issues/16506 once the old emoji
// format is no longer being used
const emoji = EmojiUtils.findEmojiByCode(reactionObject.code);
const existingReactionObject = lodashGet(existingReactions, [emoji.name]);
// Only use skin tone if emoji supports it
const skinTone = emoji.types === undefined ? -1 : paramSkinTone;
if (existingReactionObject && hasAccountIDEmojiReacted(currentUserAccountID, existingReactionObject.users, skinTone)) {
removeEmojiReaction(reportID, reportAction.reportActionID, emoji);
return;
}
addEmojiReaction(reportID, reportAction.reportActionID, emoji, skinTone);
}

We execute the [add/remove]EmojiReaction operation against the thread report while it should be executed against the original report where it exists for the given reportAction.

The reason for this is the following: when creating a thread, only the author of the thread and the author of the original message are subscribed to it. So if the author of the original message initiates the thread, only this user will be subscribed to the thread report updates (until the other user opens the thread).
So for the emoji updates, we want to notify the original report instead of the thread report.

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

    if (existingReactionObject && hasAccountIDEmojiReacted(currentUserAccountID, existingReactionObject.users, skinTone)) {
-        removeEmojiReaction(reportID, reportAction.reportActionID, emoji);
+        removeEmojiReaction(originalReportID, reportAction.reportActionID, emoji);
        return;
    }

-   addEmojiReaction(reportID, reportAction.reportActionID, emoji, skinTone);
+   addEmojiReaction(originalReportID, reportAction.reportActionID, emoji, skinTone);
}

The originalReportID here is:

  • For the original action opened in a thread – the original report ID;
  • For any other action opened on the report – the corresponding report ID;

So with this change, we will make sure a relevant report is notified with an emojiReaction update in each scenario.

Result:

emojis.mp4

What alternative solutions did you explore? (Optional)

@tjferriss tjferriss removed their assignment Sep 16, 2023
@tjferriss
Copy link
Contributor

@mallenexpensify I'm not sure why we both got assigned, but if it's OK I'm going to unassign myself as I'll be mostly OOO next week.

@0xmiros
Copy link
Contributor

0xmiros commented Sep 17, 2023

@paultsimura thanks for the proposal but I don't like that solution.
Waiting for proposals.

@paultsimura
Copy link
Contributor

@0xmiroslav could you please elaborate a little so I can know in which direction to look?
Why is reconnecting to a child report a bad approach?

@0xmiros
Copy link
Contributor

0xmiros commented Sep 17, 2023

@0xmiroslav could you please elaborate a little so I can know in which direction to look? Why is reconnecting to a child report a bad approach?

First of all, performance impact

@paultsimura

This comment was marked as outdated.

@paultsimura
Copy link
Contributor

Proposal

Updated proposal: #27536 (comment)

Just to follow the guideline standard.

@mallenexpensify
Copy link
Contributor

mallenexpensify commented Sep 19, 2023

@0xmiroslav , please review @paultsimura 's updated proposal, thx

@melvin-bot melvin-bot bot added the Overdue label Sep 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

@mallenexpensify, @0xmiroslav Whoops! This issue is 2 days overdue. Let's get this updated quick!

@0xmiros
Copy link
Contributor

0xmiros commented Sep 22, 2023

@paultsimura still I don't like that solution. We should not reconnect on ReportActionItem. Please be more familiar with our codebase.
I think this is recent regression. Used to work before. are you able to find offending PR?

Still awaiting proposals

@melvin-bot melvin-bot bot removed the Overdue label Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 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 Sep 25, 2023
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

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

Offer link
Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

📣 @paultsimura 🎉 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 📖

@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

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

Offer link
Upwork job

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Oct 4, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Oct 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

🎯 ⚡️ Woah @0xmiroslav / @paultsimura, 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 @paultsimura got assigned: 2023-10-04 09:04:06 Z
  • when the PR got merged: 2023-10-06 10:11:17 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 Oct 11, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - Reaction does not show on immediately other side [HOLD for payment 2023-10-18] [$1000] Web - Reaction does not show on immediately other side Oct 11, 2023
@melvin-bot
Copy link

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

melvin-bot bot commented Oct 11, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.80-3 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-18. 🎊

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

  • [@0xmiroslav] The PR that introduced the bug has been identified. Link to the PR:
  • [@0xmiroslav] 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:
  • [@0xmiroslav] 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:
  • [@0xmiroslav] Determine if we should create a regression test for this bug.
  • [@0xmiroslav] 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.
  • [@mallenexpensify] 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 Overdue and removed Weekly KSv2 labels Oct 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

@Julesssss, @paultsimura, @mallenexpensify, @0xmiroslav Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@mallenexpensify
Copy link
Contributor

mallenexpensify commented Oct 20, 2023

Issue reporter: @gadhiyamanan paid $50 via Upwork
Contributor: @paultsimura paid $1500 via Upwork, inc. urgency bonus
Contributor+: @0xmiroslav is due $1500.

@melvin-bot melvin-bot bot removed the Overdue label Oct 20, 2023
@paultsimura
Copy link
Contributor

Thank you @mallenexpensify.
I think there was some confusion regarding C+ — @0xmiroslav was the one responsible for this issue.

@melvin-bot melvin-bot bot added the Overdue label Oct 23, 2023
@Julesssss
Copy link
Contributor

Can be paid

@melvin-bot melvin-bot bot removed the Overdue label Oct 23, 2023
@mallenexpensify
Copy link
Contributor

Thanks @paultsimura , no idea how I mess that up, I've updated post above to:

Contributor+: @0xmiroslav is due $1500.

@0xmiroslav have you figured out Upwork issues with your account?

@0xmiros
Copy link
Contributor

0xmiros commented Oct 23, 2023

Still discussing. Let's close this for now.

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

8 participants