When an entity gets reported, save a copy that can't be edited
0/4
threads resolved
changed the description
added 9 commits
-
f9832ac2...a8381450 - 8 commits from branch
master - 431d06ca - Merge remote-tracking branch 'origin/master' into feat/copy-entity-for-jury
-
f9832ac2...a8381450 - 8 commits from branch
added 4 commits
- 67399b12 - (fix): Sensible defaults to avoid endless Pro redirection
- 2cd34f17 - Merge remote-tracking branch 'origin/master' into hotfix/local-stack-infinite-redir
- b2f5fdb1 - Merge branch 'hotfix/local-stack-infinite-redir' into feat/copy-entity-for-jury
- ec29cda7 - Putting back in the null check on get state because it seems to loading null somewhere
Toggle commit list- Developer
Original entities on review site cassandra
cqlsh:minds> select original_entity from moderation_reports ; original_entity ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ {"guid":"1010968456608092174","type":"activity","time_created":"1566409662","time_updated":"1566409662","container_guid":"1004007168413798413","owner_guid":"1004007168413798413","access_id":"2","nsfw":[],"nsfw_lock":[],"allow_comments":true,"title":false,"blurb":false,"perma_url":false,"message":"remind test text","ownerObj":{"guid":"1004007168413798413","type":"user","subtype":false,"time_created":"1564749962","time_updated":false,"container_guid":"0","owner_guid":"0","site_guid":false,"access_id":"2","tags":[],"nsfw":[],"nsfw_lock":[],"allow_comments":false,"name":"brianhatchet3","username":"brianhatchet3","language":"en","icontime":"1566409547","legacy_guid":false,"featured_id":false,"banned":"no","ban_reason":false,"website":"","briefdescription":"","dob":"","gender":"","city":"","merchant":false,"boostProPlus":false,"fb":false,"mature":0,"monetized":"","signup_method":false,"social_profiles":[],"feature_flags":false,"programs":[],"plus":false,"hashtags":false,"verified":false,"founder":false,"disabled_boost":false,"boost_autorotate":true,"categories":[],"wire_rewards":null,"pinned_posts":[],"is_mature":false,"mature_lock":false,"last_accepted_tos":1,"opted_in_hashtags":2,"last_avatar_upload":"1566409504","canary":false,"theme":"light","toaster_notifications":true,"mode":2,"urn":"urn:user:1004007168413798413","subscribed":false,"subscriber":false,"boost_rating":1,"rewards":false,"p2p_media_enabled":false,"is_admin":false,"onchain_booster":0,"eth_wallet":"","rating":1},"containerObj":false,"thumbnail_src":false,"remind_object":{"guid":"1010968451096776710","type":"activity","time_created":"1566409661","time_updated":"1566409661","container_guid":"1004007168413798413","owner_guid":"1004007168413798413","access_id":"2","tags":[],"nsfw":[],"nsfw_lock":[],"allow_comments":true,"title":false,"blurb":false,"perma_url":false,"message":"test!!","ownerObj":{"guid":"1004007168413798413","type":"user","subtype":false,"time_created":"1564749962","time_updated":false,"container_guid":"0","owner_guid":"0","site_guid":false,"access_id":"2","tags":[],"nsfw":[],"nsfw_lock":[],"allow_comments":false,"name":"brianhatchet3","username":"brianhatchet3","language":"en","icontime":"1566409547","legacy_guid":false,"featured_id":false,"banned":"no","ban_reason":false,"website":"","briefdescription":"","dob":"","gender":"","city":"","merchant":false,"boostProPlus":false,"fb":false,"mature":"0","monetized":"","signup_method":false,"social_profiles":[],"feature_flags":false,"programs":[],"plus":false,"hashtags":false,"verified":false,"founder":false,"disabled_boost":false,"boost_autorotate":true,"categories":[],"wire_rewards":null,"pinned_posts":[],"is_mature":false,"mature_lock":false,"last_accepted_tos":"1","opted_in_hashtags":"2","last_avatar_upload":"1566409504","canary":false,"theme":"light","toaster_notifications":true,"mode":"2","urn":"urn:user:1004007168413798413","subscribed":false,"subscriber":false,"boost_rating":"1","rewards":false,"p2p_media_enabled":false,"is_admin":false,"onchain_booster":"0","eth_wallet":"","rating":"1"},"containerObj":false,"thumbnail_src":false,"remind_object":false,"entity_guid":false,"featured":false,"featured_guid":false,"custom_type":false,"custom_data":false,"thumbs:up:count":"0","thumbs:up:user_guids":[],"thumbs:down:count":"0","thumbs:down:user_guids":false,"p2p_boosted":false,"mature":false,"monetized":false,"paywall":"","edited":"","comments_enabled":true,"wire_totals":{"tokens":"0"},"boost_rejection_reason":"-1","pending":"","rating":"2","ephemeral":false,"hide_impressions":false,"pinned":false,"comments:count":"0","urn":"urn:activity:1010968451096776710","impressions":"0","reminds":"0","wire_threshold":null},"entity_guid":false,"featured":false,"featured_guid":false,"custom_type":false,"custom_data":false,"thumbs:up:count":1,"thumbs:up:user_guids":["1025784527299022860"],"thumbs:down:count":0,"thumbs:down:user_guids":false,"p2p_boosted":false,"mature":false,"monetized":false,"paywall":"","edited":"","comments_enabled":true,"wire_totals":{"tokens":"0"},"boost_rejection_reason":-1,"pending":"","rating":2,"ephemeral":false,"hide_impressions":false,"pinned":false,"comments:count":1,"urn":"urn:activity:1010968456608092174","impressions":19,"reminds":1,"wire_threshold":null,"time_sent":null,"thumbnails":[]} {"guid":"1076609158125457413","type":"activity","time_created":"1582059625","time_updated":"1582059625","container_guid":"1004007168413798413","owner_guid":"1004007168413798413","access_id":"2","tags":[],"nsfw":[],"nsfw_lock":[],"allow_comments":true,"title":false,"blurb":false,"perma_url":false,"message":"Report this!","ownerObj":{"guid":"1004007168413798413","type":"user","subtype":false,"time_created":"1564749962","time_updated":false,"container_guid":"0","owner_guid":"0","site_guid":false,"access_id":"2","tags":[],"nsfw":[],"nsfw_lock":[],"allow_comments":false,"name":"brianhatchet3","username":"brianhatchet3","language":"en","icontime":"1566831985","legacy_guid":false,"featured_id":false,"banned":"no","ban_reason":false,"website":"","briefdescription":"","gender":"","city":"","merchant":false,"boostProPlus":false,"fb":false,"mature":0,"monetized":"","signup_method":false,"social_profiles":[],"feature_flags":false,"programs":[],"plus":false,"hashtags":false,"verified":false,"founder":false,"disabled_boost":false,"boost_autorotate":true,"categories":[],"wire_rewards":null,"pinned_posts":[],"is_mature":false,"mature_lock":false,"last_accepted_tos":1,"opted_in_hashtags":2,"last_avatar_upload":"1566409504","canary":false,"theme":"light","toaster_notifications":true,"mode":0,"btc_address":"","surge_token":"","urn":"urn:user:1004007168413798413","subscribed":false,"subscriber":false,"boost_rating":1,"pro":false,"pro_published":false,"rewards":true,"p2p_media_enabled":false,"is_admin":false,"onchain_booster":0,"email_confirmed":true,"eth_wallet":"","rating":1},"containerObj":false,"thumbnail_src":false,"remind_object":false,"entity_guid":false,"featured":false,"featured_guid":false,"custom_type":false,"custom_data":false,"thumbs:up:count":0,"thumbs:up:user_guids":[],"thumbs:down:count":0,"thumbs:down:user_guids":false,"p2p_boosted":false,"mature":false,"monetized":false,"paywall":"","edited":"","comments_enabled":true,"wire_totals":{"tokens":"0"},"boost_rejection_reason":-1,"pending":"","rating":2,"ephemeral":false,"hide_impressions":false,"pinned":false,"time_sent":1582059625,"comments:count":0,"urn":"urn:activity:1076609158125457413","impressions":8,"reminds":0,"wire_threshold":null,"thumbnails":[]} {"guid":"1076609158125457413","type":"activity","time_created":"1582059625","time_updated":"1582059625","container_guid":"1004007168413798413","owner_guid":"1004007168413798413","access_id":"2","tags":[],"nsfw":[],"nsfw_lock":[],"allow_comments":true,"title":false,"blurb":false,"perma_url":false,"message":"Report this!","ownerObj":{"guid":"1004007168413798413","type":"user","subtype":false,"time_created":"1564749962","time_updated":false,"container_guid":"0","owner_guid":"0","site_guid":false,"access_id":"2","tags":[],"nsfw":[],"nsfw_lock":[],"allow_comments":false,"name":"brianhatchet3","username":"brianhatchet3","language":"en","icontime":"1566831985","legacy_guid":false,"featured_id":false,"banned":"no","ban_reason":false,"website":"","briefdescription":"","gender":"","city":"","merchant":false,"boostProPlus":false,"fb":false,"mature":0,"monetized":"","signup_method":false,"social_profiles":[],"feature_flags":false,"programs":[],"plus":false,"hashtags":false,"verified":false,"founder":false,"disabled_boost":false,"boost_autorotate":true,"categories":[],"wire_rewards":null,"pinned_posts":[],"is_mature":false,"mature_lock":false,"last_accepted_tos":1,"opted_in_hashtags":2,"last_avatar_upload":"1566409504","canary":false,"theme":"light","toaster_notifications":true,"mode":0,"btc_address":"","surge_token":"","urn":"urn:user:1004007168413798413","subscribed":false,"subscriber":false,"boost_rating":1,"pro":false,"pro_published":false,"rewards":true,"p2p_media_enabled":false,"is_admin":false,"onchain_booster":0,"email_confirmed":true,"eth_wallet":"","rating":1},"containerObj":false,"thumbnail_src":false,"remind_object":false,"entity_guid":false,"featured":false,"featured_guid":false,"custom_type":false,"custom_data":false,"thumbs:up:count":0,"thumbs:up:user_guids":[],"thumbs:down:count":0,"thumbs:down:user_guids":false,"p2p_boosted":false,"mature":false,"monetized":false,"paywall":"","edited":"","comments_enabled":true,"wire_totals":{"tokens":"0"},"boost_rejection_reason":-1,"pending":"","rating":2,"ephemeral":false,"hide_impressions":false,"pinned":false,"time_sent":1582059625,"comments:count":0,"urn":"urn:activity:1076609158125457413","impressions":3,"reminds":0,"wire_threshold":null,"thumbnails":[]} (3 rows) cqlsh:minds> select original_entity from moderation_reports ; approved this merge request
- Developer
Note the cassandra change @markeharding
- Owner
@brianhatchet We should only be doing the entity snapshot after the initial jury (admins), not on the report.
added scoped label
259 254 ->setUserHashes( 260 255 isset($row['user_hashes']) ? 261 256 $row['user_hashes']->values() : null 262 ); 257 ) 258 ->setOriginalEntity(isset($row['original_entity']) ? $this->buildFromJson($row['original_entity']) : null); 263 259 return $report; 264 260 } 261 262 263 private function buildFromJson(string $data) - Owner
Need code docs here and return type
259 254 ->setUserHashes( 260 255 isset($row['user_hashes']) ? 261 256 $row['user_hashes']->values() : null 262 ); 257 ) 258 ->setOriginalEntity(isset($row['original_entity']) ? $this->buildFromJson($row['original_entity']) : null); 263 259 return $report; 264 260 } 261 262 263 private function buildFromJson(string $data) 264 { 265 $arr = json_decode($data, true); - Owner
Why are we looping and why only on level one? Perhaps we should use
Entities\Factory::build()?
263 private function buildFromJson(string $data) 264 { 265 $arr = json_decode($data, true); 266 267 foreach ($arr as $k => $v) { 268 if ($this->isJson($v)) { 269 $v = json_decode($v, true); 270 } 271 272 $arr[$k] = $v; 273 } 274 275 return $arr; 276 } 277 278 private function isJson($string) - Owner
Use
Helpers\Validationinstead
51 51 $statement = "UPDATE moderation_reports 52 52 SET reports += ?, 53 53 state = 'reported', 54 entity_owner_guid = ?"; 55 54 entity_owner_guid = ?, 55 original_entity = ?"; - Owner
we should only update if we have an original entity, (post first jury).