Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • Sign in / Register
Minds Backend - Engine
Minds Backend - Engine
  • Project overview
  • Repository
  • Issues 302
  • Merge Requests 39
  • CI / CD
  • Security & Compliance
  • Packages
  • Wiki
  • Snippets
  • Members
  • Collapse sidebar
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds Backend - EngineMinds Backend - Engine
  • Merge Requests
  • !374

Open
Opened 1 month ago by Ben Hayward@benhayward.ben
Report abuse

[Sprint/PinkPanther](fix): Delete activity after moderation queue rejection #504

Closes #504

Summary

On production right now, if you reject a post in a group you moderate, the post no longer appears in the queue, but still shows up in the feed for mods only like so:

image

Testing

  1. Make a group, make it moderated.
  2. Login to a secondary account, create posts numbered 1, 2, 3, 4, 5.
  3. Log-in to primary account, look at the group, see the posts with "awaiting moderation"
  4. Go to the moderation queue and reject the post numbered 3.
  5. Check that the activity with the content '3' is not visible on the feed with its "awaiting moderation"
Request to merge fix/delete-activity-mod-queue-504 into master
Open in Web IDE
Pipeline #96800446 passed for cbd860b3 on fix/delete-activity-mod-queue-504
          Requires 3 more approvals from Devs, Deployers, and QA.
          Olivia Madrid
          Olivia Madrid
          Emiliano Balbuena
          Emiliano Balbuena
          Rami Albatal
          Rami Albatal
          Brian Hatchet
          Brian Hatchet
          Mark Harding
          Mark Harding
          Ready to be merged automatically. Ask someone with write access to this repository to merge this request

          Closes #504

          Deletes source branch

          • Discussion 4
          • Commits 3
          • Pipelines 3
          • Changes 3
          0/4 threads resolved
          • Ben Hayward @benhayward.ben added MR::Awaiting Review Squad::Yellow scoped labels 1 month ago

            added scoped labels

          • Ben Hayward @benhayward.ben added 69 commits 12 hours ago

            added 69 commits

            • 52f5c842...a8a3fed6 - 68 commits from branch master
            • 009351e2 - Merge branch 'master' of gitlab.com:minds/engine into fix/delete-activity-mod-queue-504

            Compare with previous version

          • Ben Hayward @benhayward.ben added 1 commit 12 hours ago

            added 1 commit

            • cbd860b3 - Update

            Compare with previous version

          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 3 minutes ago
            Core/Groups/Delegates/PropagateRejection.php
            7 /**
            8 * Class PropagateRejection
            9 *
            10 * Propagates activity deletion from the group feed after rejection.
            11 * @package Minds\Core\Groups\Delegates
            12 * @author Ben Hayward
            13 */
            14 class PropagateRejection
            15 {
            16 /**
            17 * Deletes an activity associated with a rejected post.
            18 *
            19 * @param string $guid - activity guid.
            20 * @return boolean - whether deletion was successful
            21 */
            22 public function deleteActivity($guid): bool
            • Mark Harding
              Mark Harding @markeharding · 3 minutes ago
              Owner

              delegate should be void

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 3 minutes ago
            Core/Groups/Delegates/PropagateRejection.php
            1 <?php
            2
            3 namespace Minds\Core\Groups\Delegates;
            4
            5 use Minds\Entities\Activity;
            6
            7 /**
            8 * Class PropagateRejection
            9 *
            10 * Propagates activity deletion from the group feed after rejection.
            11 * @package Minds\Core\Groups\Delegates
            12 * @author Ben Hayward
            13 */
            14 class PropagateRejection
            • Mark Harding
              Mark Harding @markeharding · 3 minutes ago
              Owner

              Can you name class PropagateRejectionDelegate?

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 3 minutes ago
            Core/Groups/Feeds.php
            217 222 $this->sendNotification('reject', $activity);
            218 223 }
            219 224
            225 $this->propagateRejection->deleteActivity($activity->guid);
            • Mark Harding
              Mark Harding @markeharding · 3 minutes ago
              Owner

              Delegates should have context as to their parent functions. Ideally this function would be called onReject and pass through the entire object, not just the guid.

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 3 minutes ago
            Core/Groups/Delegates/PropagateRejection.php
            10 * Propagates activity deletion from the group feed after rejection.
            11 * @package Minds\Core\Groups\Delegates
            12 * @author Ben Hayward
            13 */
            14 class PropagateRejection
            15 {
            16 /**
            17 * Deletes an activity associated with a rejected post.
            18 *
            19 * @param string $guid - activity guid.
            20 * @return boolean - whether deletion was successful
            21 */
            22 public function deleteActivity($guid): bool
            23 {
            24 $activity = new Activity($guid);
            25 return $activity->delete();
            • Mark Harding
              Mark Harding @markeharding · 3 minutes ago
              Owner

              Core\Entities\Actions\Delete should be used instead.

            • Please register or sign in to reply
          • Mark Harding @markeharding added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label 3 minutes ago

            added scoped label and automatically removed label

          Please register or sign in to reply
          0 Assignees
          None
          None
          Milestone
          None
          Time tracking
          No estimate or time spent
          2
          Labels
          MR::Requires Changes Squad::Yellow
          Lock merge request
          Unlocked
          10
          10 participants
          user avatar
          Olivia Madrid
          user avatar
          Emiliano Balbuena
          user avatar
          Rami Albatal
          user avatar
          Brian Hatchet
          user avatar
          Mark Harding
          user avatar
          Guy Thouret
          user avatar
          Martin Santangelo
          Reference: minds/engine!374