You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-07-10] [$1000] Users are able to flag their own comment #21212
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Please re-state the problem that we are trying to solve in this issue.
Users are able to flag their own comment.
What is the root cause of that problem?
We are not checking if current reportAction is your own comment inside FlagCommentPage.
What changes do you think we should make in order to solve the problem?
We should check if current reportAction is your own reportAction then we can decide the next step (it's depend on expected behavior). We can show not found view or set severityMenuItems to empty and leave a placeholder or dismiss the modal.
const[shouldShowBlockingView,setShowBlockingView]=React.useState(false)React.useEffect(()=>{letreportToCheck;// handle for threadif(reportAction===undefined){reportToCheck=ReportActionsUtils.getParentReportAction(props.report);}else{reportToCheck=reportAction}if(props.session.email===reportToCheck.actorEmail){setShowBlockingView(true);// or we can dismiss this modal}},[reportAction,props.report]);if(shouldShowBlockingView){return<NotFoundPage/>}
What alternative solutions did you explore? (Optional)
As this comment, In case, one account has 2 contact method (A and B), If we decide that A can't flag the comment of B we can update canEditReportAction function (because as I suggest above, we also use this function in FlagCommentPage)
I'm Yogesh, a seasoned web developer with a robust track record on Upwork. My profile, which can be viewed here: https://www.upwork.com/freelancers/~01ca41cc1d47038084, showcases my 100% job success rate and a slew of positive reviews from satisfied clients. For a comprehensive look at the diverse projects I've contributed to, feel free to visit my portfolio at yogeshbhatt.com.
On to the matter at hand: users being able to flag their own comments. My initial approach to resolve this would be to implement a backend check that verifies whether the commenter and the flagger are the same person. The outcome of this check could then be relayed to the frontend, where an appropriate error message could be displayed if necessary.
However, it's important to note that the exact solution can only be ascertained after a thorough examination of your existing codebase and its architecture. As such, while the approach I've outlined seems plausible based on the information currently at hand, I would need to delve deeper into your code to confirm its viability and ensure its seamless integration with your current setup.
As an experienced contributor, I've familiarized myself thoroughly with your Contributor Guidelines and README documentation. If granted the opportunity, I'm ready to uphold the highest standards of coding and conduct as part of your team.
I look forward to the possibility of working together and helping to further enhance the user experience on your platform.
@dukenv0307 sent the contract to you in UpWork — let me know as soon as you accept it and I can get that paid to you ASAP. Thanks for your patience, and sorry for the delay!
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Jun 21, 2023
Triggered auto assignment to @abekkala (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jun 21, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)kbecciv commentedon Jun 21, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Users are able to flag their own comment.
What is the root cause of that problem?
We are not checking if current
reportActionis your own comment insideFlagCommentPage.What changes do you think we should make in order to solve the problem?
We should check if current
reportActionis your ownreportActionthen we can decide the next step (it's depend on expected behavior). We can show not found view or setseverityMenuItemsto empty and leave a placeholder or dismiss the modal.What alternative solutions did you explore? (Optional)
N/A
dukenv0307 commentedon Jun 21, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Users are able to flag their own comment
What is the root cause of that problem?
We don't prevent the user access to the page to flag their comment by URL flag/:reportID/:reportActionID
What changes do you think we should make in order to solve the problem?
In FlagCommentPage, We should use FullPageNotFoundView with conditions like here
App/src/pages/home/report/ContextMenu/ContextMenuActions.js
Lines 317 to 323 in 5f5dd02
Also should use isLoadingReportData props from ONYX to check if the app is loading
We also should move this code to outer of FlagComment Function to handle thread case
App/src/pages/FlagCommentPage.js
Lines 119 to 122 in 0b7455f
As this comment, In case, one account has 2 contact method (A and B), If we decide that A can't flag the comment of B we can update canEditReportAction function (because as I suggest above, we also use this function in FlagCommentPage)
App/src/libs/ReportUtils.js
Lines 201 to 210 in 5f5dd02
We can use props.loginList instead of only sessionEmail to check
Result
[-]Users are able to flag their own comment[/-][+][$1000] Users are able to flag their own comment[/+]melvin-bot commentedon Jun 21, 2023
Job added to Upwork: https://www.upwork.com/jobs/~012f9f19f3eff4c785
melvin-bot commentedon Jun 21, 2023
Current assignee @abekkala is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Jun 21, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (
External)ygshbht commentedon Jun 21, 2023
Proposal
Hello Expensify Team,
I'm Yogesh, a seasoned web developer with a robust track record on Upwork. My profile, which can be viewed here: https://www.upwork.com/freelancers/~01ca41cc1d47038084, showcases my 100% job success rate and a slew of positive reviews from satisfied clients. For a comprehensive look at the diverse projects I've contributed to, feel free to visit my portfolio at yogeshbhatt.com.
On to the matter at hand: users being able to flag their own comments. My initial approach to resolve this would be to implement a backend check that verifies whether the commenter and the flagger are the same person. The outcome of this check could then be relayed to the frontend, where an appropriate error message could be displayed if necessary.
However, it's important to note that the exact solution can only be ascertained after a thorough examination of your existing codebase and its architecture. As such, while the approach I've outlined seems plausible based on the information currently at hand, I would need to delve deeper into your code to confirm its viability and ensure its seamless integration with your current setup.
As an experienced contributor, I've familiarized myself thoroughly with your Contributor Guidelines and README documentation. If granted the opportunity, I'm ready to uphold the highest standards of coding and conduct as part of your team.
I look forward to the possibility of working together and helping to further enhance the user experience on your platform.
Best regards,
Yogesh
59 remaining items
CortneyOfstad commentedon Jul 18, 2023
@dukenv0307 sent the contract to you in UpWork — let me know as soon as you accept it and I can get that paid to you ASAP. Thanks for your patience, and sorry for the delay!
dukenv0307 commentedon Jul 18, 2023
@CortneyOfstad accepted, thank you!
CortneyOfstad commentedon Jul 18, 2023
Contract paid and completed! Closing!
hungvu193 commentedon Jul 18, 2023
@CortneyOfstad you forgot me 🥲
CortneyOfstad commentedon Jul 18, 2023
So I'm a bit confused. @mananjadhav can you provide some context?
hungvu193 commentedon Jul 18, 2023
Ah I'm the reporter
CortneyOfstad commentedon Jul 18, 2023
OMG, I am so sorry! It's been a while since I've had to do this, so I'm a bit rusty! 😂
Paying you now!! So sorry!!
hungvu193 commentedon Jul 18, 2023
No worries 🤣
CortneyOfstad commentedon Jul 18, 2023
All paid!
mananjadhav commentedon Jul 18, 2023
Thanks @CortneyOfstad. Can we close this now?
CortneyOfstad commentedon Jul 18, 2023
Yep — closing now!