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 2022-11-29] [$250] Deleting a comment unresponsive after right click to copy - reported by @gadhiyamanan #11086

Closed
mvtglobally opened this issue Sep 19, 2022 · 55 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@mvtglobally
Copy link

mvtglobally commented Sep 19, 2022

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. Go to any chat > long press on any message
  2. click copy to clipboard or mark as read
  3. before closing popup click on delete comment

Expected Result:

Message should be deleted

Actual Result:

Message is not deleted

Workaround:

unknown

Platform:

Where is this issue occurring?

  • Android

Version Number: 1.1.99-0
Reproducible in staging?: Y
Reproducible in production?: Y
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_20220828-132253_One.UI.Home.mp4

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

View all open jobs on GitHub

@mvtglobally mvtglobally added AutoAssignerTriage Auto assign issues for triage to an available triage team member Daily KSv2 labels Sep 19, 2022
@melvin-bot
Copy link

melvin-bot bot commented Sep 19, 2022

Triggered auto assignment to @RachCHopkins (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@melvin-bot melvin-bot bot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Sep 19, 2022
@RachCHopkins
Copy link
Contributor

Working on v1.2.0-8

@gadhiyamanan
Copy link
Contributor

@RachCHopkins
Copy link
Contributor

I'm unable to reproduce this - has anyone else reported the same problem?

@RachCHopkins RachCHopkins removed their assignment Sep 20, 2022
@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2022

Triggered auto assignment to @deetergp (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@deetergp
Copy link
Contributor

@RachCHopkins I am also unable to reproduce this 🤷 and my message deleted fine. I'm inclined to close it…

@gadhiyamanan
Copy link
Contributor

strange... but I am still not able to delete the message by following the steps
Version(v1.2.3-0)

Go to any chat > long press on any message
click copy to clipboard or mark as read
before closing popup click on delete comment

Screen.Recording.2022-09-21.at.10.36.30.AM.mov

cc: @deetergp

@melvin-bot melvin-bot bot added the Overdue label Sep 23, 2022
@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2022

@deetergp Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot removed the Overdue label Sep 26, 2022
@gadhiyamanan
Copy link
Contributor

gadhiyamanan commented Sep 28, 2022

@deetergp still not able to delete message with latest version after mark as read or copy to clipboard
https://user-images.githubusercontent.com/54790231/192721948-a1e0dcf8-bcc5-4e7e-bbe8-0389ddaef997.mp4

@muttmuure muttmuure changed the title Android - App crash on delete message - reported by @gadhiyamanan Deleting a comment unresponsive after right click to copy - reported by @gadhiyamanan Nov 7, 2022
@muttmuure muttmuure reopened this Nov 7, 2022
@muttmuure
Copy link
Contributor

I've reproduced this on web and iOS.

Reproduction steps are correct.

Adding external label

Copy.and.Delete.not.actioned.mp4

@muttmuure muttmuure added the External Added to denote the issue can be worked on by a contributor label Nov 7, 2022
@melvin-bot
Copy link

melvin-bot bot commented Nov 7, 2022

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

@melvin-bot
Copy link

melvin-bot bot commented Nov 7, 2022

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 7, 2022
@melvin-bot
Copy link

melvin-bot bot commented Nov 7, 2022

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

@0xmiros
Copy link
Contributor

0xmiros commented Nov 21, 2022

This proposal is mutating the state. From my knowledge of React, this is something that should be completely avoided and can cause hard to track bugs, are there cases where mutations of the state is acceptable? No, as far as I know, but please let me know if I'm wrong about this.

This is usually the case when no need to re-render because of state update.
Of course we can use class member variable (i.e. this.reportID) instead of state variable (i.e. this.state.reportID) to avoid re-render but in this component, it's fine and safe to mutate those directly.

@mananjadhav
Copy link
Collaborator

@Pujan92 We have a regression on this issue, that we'll have to fix. Please create a fresh PR to fix the issue and then we can review.

@aldo-expensify
Copy link
Contributor

aldo-expensify commented Nov 22, 2022

This proposal is mutating the state. From my knowledge of React, this is something that should be completely avoided and can cause hard to track bugs, are there cases where mutations of the state is acceptable? No, as far as I know, but please let me know if I'm wrong about this.

This is usually the case when no need to re-render because of state update. Of course we can use class member variable (i.e. this.reportID) instead of state variable (i.e. this.state.reportID) to avoid re-render but in this component, it's fine and safe to mutate those directly.

I understand the point that it may be safe in this specific case at this time, but this type of code removes the assumption that the state is immutable. Removing that assumptions open the door for future bugs because other developers won't expect this, also, simple references check are not longer enough for checking equality. In my opinion it is similar to storing your state in window, yes, it may work, but at some point you will have hard to follow buggy code that breaks all the time because it is outside of what we can expect in react.

I'm not very familiarized with class component, but yes, I think we use class members variable for the cases. In functional react, this can be done with useRef because the reference.current is mutable.

Found this in the react documentation that talks about this: https://reactjs.org/docs/react-component.html#state
Seems like the way to go is to use class member variables if you want to do something like that.

@Pujan92
Copy link
Contributor

Pujan92 commented Nov 22, 2022

Sorry for the regression issue. I think updating the hideContextMenu with the check of the callback function which gets passed when there is a delay in context menu action can solve the issue. So if the action is deleting the comment we won't update the state from hideContextMenu method otherwise it(delete modal) won't have the reportID and reportAction.

hideContextMenu(onHideActionCallback) {
        if (_.isFunction(onHideActionCallback)) {
            this.onPopoverHideActionCallback = onHideActionCallback;
            if (!this.state.isDeleteCommentConfirmModalVisible) {
                this.setState({
                    reportID: '0',
                    reportAction: {},
                    selection: '',
                    reportActionDraftMessage: '',
                    isPopoverVisible: false,
                });
            }
        } else {
            this.setState({
                reportID: '0',
                reportAction: {},
                selection: '',
                reportActionDraftMessage: '',
                isPopoverVisible: false,
            });
        }
    }
Recording_1669097982090.webm

@mountiny mountiny added the Awaiting Payment Auto-added when associated PR is deployed to production label Nov 22, 2022
@mountiny mountiny changed the title [$250] Deleting a comment unresponsive after right click to copy - reported by @gadhiyamanan [HOLD for payment 2022-11-29] [$250] Deleting a comment unresponsive after right click to copy - reported by @gadhiyamanan Nov 22, 2022
@mananjadhav
Copy link
Collaborator

mananjadhav commented Nov 23, 2022

@Pujan92 thanks for the quick PR, I'll try to get this one before tomorrow.

@mananjadhav
Copy link
Collaborator

@muttmuure Payment date to be removed, as it caused a regression.

@Pujan92
Copy link
Contributor

Pujan92 commented Nov 26, 2022

@Pujan92 thanks for the quick PR, I'll try to get this one before tomorrow.

@mananjadhav Could you plz review once you get some time

@mananjadhav
Copy link
Collaborator

Apologies for the delay here. I'll review it by EOD today!

@melvin-bot melvin-bot bot added Daily KSv2 and removed Daily KSv2 labels Nov 29, 2022
@0xmiros
Copy link
Contributor

0xmiros commented Dec 2, 2022

I think I am eligible for compensation since my solution was picked up and merged
ref: #12917 (comment)

@mananjadhav
Copy link
Collaborator

This was deployed to production but title for the payment date isn't updated.

@muttmuure please note this had a regression so C+ payment has to be adjusted accordingly.

@mananjadhav
Copy link
Collaborator

@deetergp @muttmuure quick bump

@Pujan92
Copy link
Contributor

Pujan92 commented Dec 15, 2022

@muttmuure Are we fine to complete this?

@muttmuure
Copy link
Contributor

Thanks for the bump guys - getting this sorted today

@muttmuure
Copy link
Contributor

OK by the logic of Stack Overflow:

@Pujan92 = $250
@0xmiroslav = $250
@mananjadhav = $125

The job is here:

https://www.upwork.com/jobs/~012e1e9aa00357fd02

Please could you apply and we'll get you paid and close this out

@Pujan92
Copy link
Contributor

Pujan92 commented Dec 16, 2022

https://www.upwork.com/jobs/~012e1e9aa00357fd02
Please could you apply and we'll get you paid and close this out

I have already applied for the earlier posted job(https://www.upwork.com/jobs/~01bc6b990f835122e4)

@0xmiros
Copy link
Contributor

0xmiros commented Dec 16, 2022

@muttmuure applied

@gadhiyamanan
Copy link
Contributor

@muttmuure applied for reporting

@mananjadhav
Copy link
Collaborator

Applied @muttmuure

@muttmuure
Copy link
Contributor

@Pujan92 the older job expired, apologies, so you need to apply to the new one.

@Pujan92
Copy link
Contributor

Pujan92 commented Dec 16, 2022

@Pujan92 the older job expired, apologies, so you need to apply to the new one.

@muttmuure actually it was offered and I accepted earlier, milestone is also active within it. Can you plz check once?

@muttmuure
Copy link
Contributor

Oh I see - sure we can do it that way too.

@muttmuure
Copy link
Contributor

Everyone has been paid - closing out. Thanks!

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 Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

10 participants