-
Notifications
You must be signed in to change notification settings - Fork 636
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
✨ Add a policy property to takedown events #3271
Conversation
"policy": { | ||
"type": "string", | ||
"description": "Name/Keyword of the policy that drove the decision." | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any merit to sprinkling this onto other event types such as modEventLabel
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Labels themselves are quite descriptive of the "why" part of the action and confirmed from T&S folks that this won't be necessary any time soon.
"policy": { | ||
"type": "string", | ||
"description": "If specified, only events where the policy matches the given policy are returned" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a decent chance we end-up wanting to list multiple policies here in the future? If so, we could proactively make this an array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
T&S expressed that this may be nice to have at some point but not anytime soon. I'll get it in the backend but the UI side will mostly keep it 1:1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple small comments, looking good! Also may want to add a changeset for @atproto/api and @atproto/ozone before merging.
) { | ||
eventView.event = { | ||
...eventView.event, | ||
policy: event.meta.policy, | ||
policies: event.meta.policies.split(' '), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look out for the empty string, which likes to split into ['']
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other words:
const policies = []
const serialized = policies.join(' ')
const deserialized = serialized.split(' ')
// we want policies and deserialized to both be `[]`
// but policies is `[]` while deserialized is `['']`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep yep! nice catch. realized the separator is an issue to start with and ended up finding this too.
This PR adds an optional
policy
property to all takedown events that allows an arbitrary string value and allows moderators to query for all takedowns by specifying apolicy
param through thqueryEvents
endpoint.