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-28] [$1000] When in editing mode, the edited message does not dynamically update between the main chat and sub-thread #22368

Closed
1 of 6 tasks
kavimuru opened this issue Jul 6, 2023 · 53 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 External Added to denote the issue can be worked on by a contributor

Comments

@kavimuru
Copy link

kavimuru commented Jul 6, 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. Login to an account
  2. Send a message - X
  3. Hover on the message X at step 2 and select the “Reply in thread” option
  4. Inside the thread, hover on X and select the “Edit” option but leave it here, DO NOT save
  5. Click the link on the chat report header to go back to “Main chat”
  6. Hover on X again, select the Edit option, change the message to Y and Save
  7. Hover on the edited message (now it became Y) and select “Reply in thread” again

Expected Result:

The pending edit text should be updated to Y (since the message ID is still the same)

Actual Result:

Pending edit text still showing as the old text - X

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

Message.not.synced.mp4
Recording.1185.mp4

Expensify/Expensify Issue URL:
Issue reported by: @tranvantoan-qn
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688569312112949

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ee387cbb35240fa6
  • Upwork Job ID: 1681534571157942272
  • 2023-07-19
  • Automatic offers:
    • mollfpr | Reviewer | 25806960
    • dukenv0307 | Contributor | 25806962
    • tranvantoan-qn | Reporter | 25806963
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 2023

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

@melvin-bot
Copy link

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

@sophiepintoraetz
Copy link
Contributor

This is not reproducible on v1.3.39-5 @tranvantoan-qn? (I'm on staging)

2023-07-11_13-02-18.mp4

@melvin-bot melvin-bot bot removed the Overdue label Jul 11, 2023
@sophiepintoraetz sophiepintoraetz added Needs Reproduction Reproducible steps needed Overdue labels Jul 11, 2023
@tranvantoan-qn
Copy link

Hi @sophiepintoraetz
It is still happening.
The steps to reproduce it is quite many and we need to do the exact steps
image

@sophiepintoraetz
Copy link
Contributor

@tranvantoan-qn if there are many steps, please can you make sure that they are fully captured in the reproduction steps?

@melvin-bot melvin-bot bot removed the Overdue label Jul 11, 2023
@tranvantoan-qn
Copy link

Yes, each step and its explanation is fully captured in the attached video above

I post the video here again

251550670-3a6600c7-3f53-44d9-b806-00fa944ac66d.mp4

@sophiepintoraetz
Copy link
Contributor

Let me upload the correct video but please can you confirm which steps aren't being completed - I am well aware of the video in the master GH.
https://github.com/Expensify/App/assets/42940078/26492833-b4db-4437-801a-c648043f234d

@tranvantoan-qn
Copy link

tranvantoan-qn commented Jul 11, 2023

Hi @sophiepintoraetz I checked your video carefully and I have identified a step that you missed:

  • at 0:07 you will need to edit the message by clicking edit button but DONT SAVE - it's the step 4 in Action Performed - IMPORTANT step (so the edit mesage popup will remain)
  • At 0:15 after editing the message in the main thread >> go back to the sub-thread and check that the old message still remains
    image

@tranvantoan-qn
Copy link

Proposal

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

When in editing mode, the edited message does not dynamically update between the main chat and sub-thread

What is the root cause of that problem?

In this follow code, we always get value from draft without checking if the message is edited

const [draft, setDraft] = useState(() => {
if (props.draftMessage === props.action.message[0].html) {
// We only convert the report action message to markdown if the draft message is unchanged.
const parser = new ExpensiMark();
return parser.htmlToMarkdown(props.draftMessage).trim();
}
// We need to decode saved draft message because it's escaped before saving.
return Str.htmlDecode(props.draftMessage);
});

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

Add a condition to check if the message is edited and published, we should get that value and use it as draft.

    const [draft, setDraft] = useState(() => {
        if (props.draftMessage === props.action.message[0].html) {
            // We only convert the report action message to markdown if the draft message is unchanged.
            const parser = new ExpensiMark();
            return parser.htmlToMarkdown(props.draftMessage).trim();
        } else {
            if (props.action.message[0].isEdited === true) {
                return Str.htmlDecode(props.action.message[0].html);
            } else {
                // We need to decode saved draft message because it's escaped before saving.
                return Str.htmlDecode(props.draftMessage);
            }
        }
    });

What alternative solutions did you explore? (Optional)

N/A

@tranvantoan-qn
Copy link

Hi @sophiepintoraetz
Did my last comment help you reproduce it?
I also added my proposal for it, I hope the team can take a look!

@sophiepintoraetz
Copy link
Contributor

Unfortunately, I've had some other priorities so I'll get to this when I can!

@melvin-bot melvin-bot bot added the Overdue label Jul 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 18, 2023

@sophiepintoraetz Huh... This is 4 days overdue. Who can take care of this?

@sophiepintoraetz
Copy link
Contributor

I think I was able to reproduce

2023-07-19_17-13-42 (1)

@melvin-bot melvin-bot bot removed the Overdue label Jul 19, 2023
@sophiepintoraetz sophiepintoraetz added the External Added to denote the issue can be worked on by a contributor label Jul 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 19, 2023

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

@melvin-bot melvin-bot bot changed the title When in editing mode, the edited message does not dynamically update between the main chat and sub-thread [$1000] When in editing mode, the edited message does not dynamically update between the main chat and sub-thread Jul 19, 2023
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 19, 2023
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 28, 2023

📣 @mollfpr 🎉 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 Jul 28, 2023

📣 @dukenv0307 🎉 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 Jul 28, 2023

📣 @tranvantoan-qn 🎉 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

@dukenv0307
Copy link
Contributor

@mollfpr The PR is ready for review #23706

@sophiepintoraetz
Copy link
Contributor

Waiting on a PR review from @youssef-lr

@youssef-lr
Copy link
Contributor

Left a minor comment on the PR!

@melvin-bot
Copy link

melvin-bot bot commented Aug 15, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @dukenv0307 got assigned: 2023-07-28 11:41:16 Z
  • when the PR got merged: 2023-08-15 01:43:59 UTC
  • days elapsed: 11

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 Aug 21, 2023
@melvin-bot melvin-bot bot changed the title [$1000] When in editing mode, the edited message does not dynamically update between the main chat and sub-thread [HOLD for payment 2023-08-28] [$1000] When in editing mode, the edited message does not dynamically update between the main chat and sub-thread Aug 21, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 21, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 21, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.55-8 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-28. 🎊

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 Aug 21, 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:

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

@sophiepintoraetz
Copy link
Contributor

Payouts due:

Issue Reporter: $250 @tranvantoan-qn - Paid
Contributor: $1000 @dukenv0307 (Assigned 28 Jul - submitted for review on 1 Aug) so I don't think this is eligible for the urgency bonus given the comment review but neither is it eligible for the penalty.
Contributor+: $1000 @mollfpr (I'll release payment once the checklist is done)

Eligible for 50% #urgency bonus? N

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

Bump @mollfpr!

@mollfpr
Copy link
Contributor

mollfpr commented Aug 29, 2023

Sorry for the delay!

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

No offending PR. We haven't implemented the sync between parent and child on the report action draft.

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

The regression step should be enough.

[@mollfpr] Determine if we should create a regression test for this bug.
[@mollfpr] 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. Login to an account
  2. Send a message - X
  3. Hover on the message X at step 2 and select the “Reply in thread” option
  4. hover on X and select the “Edit” option inside the thread, but leave it here. DO NOT save
  5. Click the link on the chat report header to go back to “Main chat”
  6. Hover on X again, select the Edit option, change the message to Y and Save
  7. Hover on the edited message (now it became Y) and select “Reply in thread” again
  8. Verify that The pending edit text should be updated to Y (since the message ID is still the same)
  9. Select Edit message X but not save
  10. Go to the thread of that message, then change the message to Z and Save
  11. Verify that The pending edit text should be updated to Z (since the message ID is still the same)
  12. 👍 or 👎

@sophiepintoraetz
Copy link
Contributor

Payment released, regression test added.

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