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-04-26] [$1000] 'Edit comment' option is available for the comment sent in a room that is now archived #17179

Closed
1 of 6 tasks
kavimuru opened this issue Apr 8, 2023 · 35 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

@kavimuru
Copy link

kavimuru commented Apr 8, 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. Go to Settings > Workspaces
  2. Create any workspace
  3. Go to that workspace's admin room
  4. Send any message in the room
  5. Keep that room open and go to the workspace
  6. Click on three vertical dots
  7. Delete workspace
  8. Hover over the comment you send and click 'Edit comment'

Expected Result:

'Edit comment' option should not be there

Actual Result:

'Edit comment' option is there

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.2.97-2
Reproducible in staging?:
Reproducible in production?:
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.170.mp4
Screen.Recording.2023-04-07.at.10.41.03.PM.mov

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013e9ed39c89a615a2
  • Upwork Job ID: 1645440877358878720
  • Last Price Increase: 2023-04-10
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 8, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Apr 8, 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 Apr 10, 2023
@CortneyOfstad
Copy link
Contributor

Was able to recreate this as shown below:

2023-04-10_09-55-59 (1)

Getting some eyes on this

@melvin-bot melvin-bot bot removed the Overdue label Apr 10, 2023
@CortneyOfstad CortneyOfstad added the External Added to denote the issue can be worked on by a contributor label Apr 10, 2023
@melvin-bot melvin-bot bot changed the title 'Edit comment' option is available for the comment sent in a room that is now archived [$1000] 'Edit comment' option is available for the comment sent in a room that is now archived Apr 10, 2023
@MelvinBot
Copy link

Job added to Upwork: https://www.upwork.com/jobs/~013e9ed39c89a615a2

@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

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

Proposal

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

'Edit comment' option is available for the comment sent in a room that is now archived

What is the root cause of that problem?

The root cause is that we're not updating the ReportActionsView when the report state or report status changes in the shouldComponentUpdate method. This can be seen here. This causes the ReportUtils.isArchivedRoom(this.props.report) condition defined here to return false since its using an old version of the report.

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

We need to add the following condition here.

if (
	lodashGet(this.props.report, 'statusNum') !== lodashGet(nextProps.report, 'statusNum')
	|| lodashGet(this.props.report, 'stateNum') !== lodashGet(nextProps.report, 'stateNum')
) {
	return  true;
}

Although this bug is fixed by adding the above, I found out that we are missing the same condition in this component as well. I think we should add the above condition here as well.

What alternative solutions did you explore? (Optional)

The amount of checks that we have in the shouldComponentUpdate currently are too many IMO. It might be better to remove the shouldComponentUpdate method altogether in the above components. The time required to compute the checks is more than the time required to render the component.

@MelvinBot
Copy link

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

@eh2077
Copy link
Contributor

eh2077 commented Apr 11, 2023

I can't reproduce this and found the backend send the pusher event after deleting a room. See log from console like

[info] [Report] Handled onyxApiUpdate event sent by Pusher ......

@allroundexperts
Copy link
Contributor

@esh-g This is easily reproducible if you're in offline mode. Video attached.

screen-recording-2023-04-11-at-13238-pm_V2FSQuRV.mp4

@eh2077
Copy link
Contributor

eh2077 commented Apr 11, 2023

@allroundexperts Oh I see, thank you! I followed the bug report and it doesn’t mention about offline.

@esh-g
Copy link
Contributor

esh-g commented Apr 11, 2023

@allroundexperts I think you tagged me by mistake? I didn't comment on this issue I think...

@allroundexperts
Copy link
Contributor

@allroundexperts I think you tagged me by mistake? I didn't comment on this issue I think...

@esh-g I did that by mistake. I meant to tag Eric Hans.

@thesahindia
Copy link
Member

@allroundexperts's proposal looks good to me!

C+ reviewed 🎀👀🎀

cc: @francoisl

@thesahindia
Copy link
Member

@allroundexperts, I just wanna point out that your proposal doesn't follow our proposal template correctly. We expect the contributors to explain the solution in simple english instead of pasting code.

@allroundexperts
Copy link
Contributor

allroundexperts commented Apr 11, 2023

@allroundexperts, I just wanna point out that your proposal doesn't follow our proposal template correctly. We expect the contributors to explain the solution in simple english instead of pasting code.

@thesahindia Thanks for pointing this out. But I'm not sure if I'm getting this fully. For example, in the above proposal, I've added references to our code to explain the approach. Later on, I'm also adding the lines of code which I think are required to solve the issue. Without the code, I think it wouldn't have made a lot of sense to you. I tried to be as precise as possible and avoided writing large amounts of text in my proposal because it is written so in the proposal template.

@thesahindia
Copy link
Member

I think simple english is enough. You could use something like this: "we need to add a new if statement to check if the statusNum and stateNum has changed"

@allroundexperts
Copy link
Contributor

I think simple english is enough. You could use something like this: "we need to add a new if statement to check if the statusNum and stateNum has changed"

Got it. Thanks. I'll try to improve this.

@francoisl
Copy link
Contributor

Looks good to me, let's go with your proposal @allroundexperts.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Apr 19, 2023
@melvin-bot melvin-bot bot changed the title [$1000] 'Edit comment' option is available for the comment sent in a room that is now archived [HOLD for payment 2023-04-26] [$1000] 'Edit comment' option is available for the comment sent in a room that is now archived Apr 19, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 19, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.1-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-04-26. 🎊

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

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

@MelvinBot
Copy link

MelvinBot commented Apr 19, 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:

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

@garrettmknight garrettmknight removed their assignment Apr 21, 2023
@garrettmknight garrettmknight added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Apr 21, 2023
@MelvinBot
Copy link

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Apr 21, 2023
@garrettmknight
Copy link
Contributor

Reassigning for payment next week assuming no regression. Thanks!

@Expensify Expensify deleted a comment from MelvinBot Apr 21, 2023
@garrettmknight garrettmknight added Weekly KSv2 and removed Daily KSv2 labels Apr 21, 2023
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Apr 26, 2023
@dylanexpensify
Copy link
Contributor

Payments all sent! Before closing, @thesahindia can we complete the above tasks in the checklist? Thank you!

@thesahindia
Copy link
Member

It wasn't a regression. So let's just add the test case for it.

  1. Go to Settings > Workspaces and create a workspace.
  2. Go to that workspace's admin room and send any message
  3. Go offline
  4. Go to settings > Workspaces > Choose the newly created workspace
  5. Click on three vertical dots and delete the workspace > Dismiss the RHN
  6. Right click or hover over the message that you've sent and make sure that you do not see the option to edit the message.

@melvin-bot melvin-bot bot added the Overdue label May 1, 2023
@dylanexpensify
Copy link
Contributor

Nice, thank you!

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels May 2, 2023
@dylanexpensify
Copy link
Contributor

Got it!

@melvin-bot melvin-bot bot removed the Overdue label May 5, 2023
@dylanexpensify
Copy link
Contributor

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

10 participants