-
Notifications
You must be signed in to change notification settings - Fork 3k
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 08-30-23][$1000] Web - There is a delete option on a reply inside IOU report screen on the receiver's side #23805
Comments
Triggered auto assignment to @sakluger ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.We want to hide the delete icon in the mini context menu for user A if the message was sent from user B. What is the root cause of that problem?In #18735, we added the feature for policy admins to delete any message in workspace rooms, which displayed the delete icon to workspace admins. Now when we request money from a user (in 1-1 or group chat), the requestor (User A) becomes the policy admin ( What changes do you think we should make in order to solve the problem?We can add a condition here to check if the report belongs to a workspace or is a 1-1/group report by checking the
this would hide the delete icon. We can also utils like What alternative solutions did you explore? (Optional)We could remove the |
@sakluger Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Thanks for the report, the video makes this issue really clear 👍 |
Job added to Upwork: https://www.upwork.com/jobs/~01b7d728393a99ac94 |
Current assignee @sakluger is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav ( |
Proposal Please re-state the problem that we are trying to solve in this issue. What is the root cause of that problem? (Taken from above to avoid confusion) Now when we request money from a user (in 1-1 or group chat), the requestor (User A) becomes the policy admin (policy.role === admin) for the money request. When the requestee (User B) replies to the money request action inside a thread, this condition becomes true for User A and shows the delete icon for User A What changes do you think we should make in order to solve the problem? Plan of action:
You can either do the block list as part of the admin until or pair it with another util. Example: (canDeleteReportActionWithAdmin && !isMoneyRequestReport) What alternative solutions did you explore? (Optional) Also - Regardless of solution breaking that canDeleteReportAction is vital to avoid running into this issue with another type down the line. It's just not clear to both have admin and owner rights checked in the same function like this. |
📣 @nickshuttle! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Thanks for the proposals folks. Both the proposals have the correct RCA, I don't like the idea of splitting Hence, @huzaifa-99's proposal here looks good to me. @huzaifa-99 I think it makes sense to use existing utils if we have any. But please note, I'll check with the BZ team member which all accesses should block the Delete action, and we should cover all of them in the current scope. @sakluger @MonilBhavsar Can you confirm the types of chat/report, etc. where we want to hide the Delete option? I can see this bug report too. 🎀 👀 🎀 C+ reviewed. |
Triggered auto assignment to @MonilBhavsar, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Thanks for the review @mananjadhav
sure thing. In that case, I think its better to wait for the team's confirmation (i.e where we want to show the delete option) and then start the pr |
I understand to some degree. However, the place this is being called already calls many utils. You know the code base far better than me but it seems like having utils with understandable outcomes is going to serve the future devs much better than a single method with many rules inside it that are murky.
These overloaded && checks like this scare me. I really would figure out how to refactor this into something not so fragile to where the menu is being loaded up. Anyway - Thank you for looking everything over. |
I agree with your points @nickshuttle. It works both ways. One having these large overloaded conditions can be daunting and definitely affect the readability, but having the same utils created based on different thread types would add to the code smells. Better way would be to split these conditions into context based flags, which then make the util more readable. |
@mananjadhav - Yeah, I understand. It's one of those things where you are stuck between things. The way it is already has code smell (Conditional Complexity) but not done correctly refactoring could put a new code smell into place. The approach right now is going to build on top of that complexity with no clear call out for the next developer. If you don't break it, I really would suggest finding a way to make it super clear to the next developer that there are XYZ conditions being checked. Once you add policy admin === true && (thisChat === true || thatChat === true) it's gonna get weird the next time some new message type needs to make this choice. Really, if you were up to bigger changes there could be a better approach where you could created some sort of rules engine instead of this direct checks on different states. That would allow for finer grained control in a much more testable/maintainable way. |
Not sure, but I think we already have some of that planned in the typescript migration. |
In both this case and the one you linked, a user is able to delete someone else's message/request. In general, a user should never be able to delete someone else's message or request. You should only be able to delete something that you created yourself. There may be other places where the delete button isn't appropriate, but I can't think of them at the moment. |
📣 @mananjadhav Please request via NewDot manual requests for the Reviewer role ($1000) |
📣 @huzaifa-99 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
📣 @Nathan-Mulugeta 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app! |
Thanks for the review and assignment, pr will be ready shortly |
PR is ready for review #24396 @mananjadhav @neil-marcellini |
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one 🚀 |
This was deployed on production 2 days ago but the title wasn't updated. |
@sakluger This was deployed to production for 7 days but the title wasn't updated. Can you please post the payout summary? @neil-marcellini I think this is eligible for the timeline bonus, as C+ review was done within the 3 days. |
I have the same request @neil-marcellini. |
@neil-marcellini @sakluger quick bump on the previous comments. |
@neil-marcellini @sakluger another follow up. |
Sorry for the delay! Yes, I reviewed the PR and this one qualifies for the bonus because it was C+ approved well within the allowed time. Summarizing payouts for this issue: Reporter: @Nathan-Mulugeta - $250 (paid on Upwork) Above payments include efficiency bonus 🎉 @huzaifa-99 could yuu please accept the offer in Upwork so that we can complete the payment? Thanks! |
Thanks @sakluger. Appreciate your help here. |
Thank you @sakluger. I have accepted the offer. |
Hey @sakluger I didn't receive any payments yet. You might have paid wrong person? |
Just received the payment thanks. |
Phew, glad you go the payment @Nathan-Mulugeta! @mananjadhav did you send the payment request in NewDot? Would you like me to leave the issue open until you've done that, or will you track and handle outside the issue? |
Yes @sakluger. I've raised the payout request on NewDot. I'll track this outside the issue. cc - @JmillsExpensify |
$1,500 approved for payment via NewDot based on BZ summary. |
Thanks everyone! |
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:
Expected Result:
There should be no delete icon on account A
Actual Result:
Account A can see and click the delete button on the reply sent from account B. And if user A deletes the message Auth error shows up
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.47-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
2023-07-28.13.22.27.mp4
Recording.3975.mp4
Expensify/Expensify Issue URL:
Issue reported by: @Nathan-Mulugeta
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690539901030749
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: