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-06-05] [HOLD] [Moderation] Create Report.flagReportAction #18506

Closed
dangrous opened this issue May 5, 2023 · 15 comments
Closed
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@dangrous
Copy link
Contributor

dangrous commented May 5, 2023

Part of NewDot Moderation - Tracking Issue and Design Doc

Design Doc Section


Once we have the flag data sent to us by using one of the severity options detailed above, we will need to send it to the backend for handling. We will create a new function in Report.js called FlagComment, which will take as parameters (reportActionID, user, severity).

The function will generate the optimisticData by adding the appropriate flag severity and decision to the message, as well as the RBR in case something goes wrong.

if (severity === 'Spam' || severity === 'Inconsiderate') {
	let decision = 'flagged';
} else {
	let decision = 'pending';
}

let newDecision = {
	"decision": decision,
};

let updatedDecisions = [...(message.moderationDecisions || []), newDecision];

const updatedMessage = {
...message,
moderationDecisions: updatedDecisions,

};

const optimisticReportActions = {
[reportActionID]: {
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
message: [updatedMessage],
},
};

const optimisticData = [
{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, value: optimisticReportActions,
},
];

const failureData = [
{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
value: {
[reportActionID]: {
...originalReportAction,
                    pendingAction: null,
},
},
},
];

const successData = [
{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
value: {
[reportActionID]: {
pendingAction: null,
},
},
},
];

In case of failure, we just return the original message.

We’ll then send the data to the api with a write command:

const parameters = {
reportID,
severity,
reportActionID: reportAction.reportActionID,
};
API.write(‘FlagComment’, parameters, {optimisticData, failureData});
@dangrous dangrous changed the title [HOLD] [Moderation] Create Report.flagReportAction() [HOLD] [Moderation] Create Report.flagReportAction May 5, 2023
@melvin-bot melvin-bot bot added the Monthly KSv2 label May 9, 2023
@dangrous dangrous added Daily KSv2 and removed Monthly KSv2 labels May 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 15, 2023

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

@melvin-bot melvin-bot bot added the Overdue label May 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 17, 2023

Still overdue 6 days?! Let's take care of this!

@melvin-bot
Copy link

melvin-bot bot commented May 19, 2023

Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

@dangrous
Copy link
Contributor Author

will get to this next week!

@melvin-bot melvin-bot bot removed the Overdue label May 19, 2023
@dangrous dangrous self-assigned this May 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 23, 2023

Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added Overdue Reviewing Has a PR in review Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Overdue Daily KSv2 labels May 23, 2023
@melvin-bot melvin-bot bot changed the title [HOLD] [Moderation] Create Report.flagReportAction [HOLD for payment 2023-06-05] [HOLD] [Moderation] Create Report.flagReportAction May 29, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 29, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 29, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.19-7 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-06-05. 🎊

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

@dangrous dangrous added the Bug Something is broken. Auto assigns a BugZero manager. label Jun 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 1, 2023

Triggered auto assignment to @kevinksullivan (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 Jun 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 1, 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

@dangrous
Copy link
Contributor Author

dangrous commented Jun 1, 2023

Not a bug, grabbing a teammate to help with payment for @allroundexperts's review.

@kevinksullivan
Copy link
Contributor

Sounds good. Payment is $1000 @dangrous ?

@melvin-bot melvin-bot bot added the Overdue label Jun 5, 2023
@dangrous
Copy link
Contributor Author

dangrous commented Jun 5, 2023

@kevinksullivan yep!

@melvin-bot melvin-bot bot added Daily KSv2 and removed Overdue Daily KSv2 labels Jun 5, 2023
@kevinksullivan
Copy link
Contributor

Hey @allroundexperts , I sent an offer for the job

https://www.upwork.com/jobs/~0131aae97657676ce2

Let me know when you accept and I'll get this paid out!

@allroundexperts
Copy link
Contributor

Hey @allroundexperts , I sent an offer for the job

https://www.upwork.com/jobs/~0131aae97657676ce2

Let me know when you accept and I'll get this paid out!

Accepted, thanks!

@melvin-bot melvin-bot bot added the Overdue label Jun 8, 2023
@melvin-bot melvin-bot bot removed the Overdue label Jun 8, 2023
@kevinksullivan
Copy link
Contributor

paid out. Upwork won't let me cancel the contract so I'll set a reminder to come back to it

image

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
Projects
None yet
Development

No branches or pull requests

3 participants