Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • Sign in / Register
Minds Backend - Engine
Minds Backend - Engine
  • Project overview
  • Repository
  • Issues 293
  • Merge Requests 37
  • 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
  • !410

Open
Opened 1 week ago by Guy Thouret@gthouret
Report abuse

WIP: Refactor Boost Code

Closes #1149

Edited 1 hour ago by Guy Thouret
Request to merge feat/1149-boost-refactor into master
The source branch is 24 commits behind the target branch
Open in Web IDE
Pipeline #101165632 passed for 079a3e91 on feat/1149-boost-refactor
          Requires 3 more approvals from Devs, Deployers, and QA.
          Rami Albatal
          Rami Albatal
          Marcelo Rivera
          Marcelo Rivera
          Mark Harding
          Mark Harding
          Emiliano Balbuena
          Emiliano Balbuena
          Brian Hatchet
          Brian Hatchet
          This is a Work in Progress

          Closes #1149

          You can merge this merge request manually using the
          • Discussion 25
          • Commits 2
          • Pipelines 11
          • Changes 56
          4/6 threads resolved
          • Guy Thouret @gthouret changed milestone to %Boost Refactor #mvp 1 week ago

            changed milestone to %Boost Refactor #mvp

          • Guy Thouret @gthouret added MR::Awaiting Review Squad::Blue scoped labels 1 week ago

            added scoped labels

          • Guy Thouret @gthouret added 1 commit 4 days ago

            added 1 commit

            • cd72577e - Refactor Boost Code - #1149

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 4 days ago

            added 1 commit

            • e7269ef5 - Refactor Boost Code - #1149

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 3 days ago

            added 1 commit

            • 6efd9e52 - Refactor Boost Code - #1149

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 3 days ago

            added 1 commit

            • 722e6865 - Refactor Boost Code - #1149

            Compare with previous version

          • Guy Thouret @gthouret unmarked as a Work In Progress 3 days ago

            unmarked as a Work In Progress

          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 2 days ago
            Last updated by Mark Harding 2 hours ago
            Core/Boost/Feed.php
            1 <?php
            2
            3 namespace Minds\Core\Boost;
            4
            5 use Minds\Core\Data\cache\abstractCacher;
            6 use Minds\Core\Entities\Resolver;
            7 use Minds\Entities\User;
            8 use Minds\Core;
            9 use Minds\Helpers\Time;
            10
            11 abstract class Feed
            • Mark Harding
              Mark Harding @markeharding · 2 days ago
              Owner

              rename to AbstractFeed

            • Guy Thouret
              Guy Thouret @gthouret · 2 days ago
              Developer

              That's not a naming convention I've ever seen/used before. Any reason for that?

            • Mark Harding
              Mark Harding @markeharding · 2 hours ago
              Owner

              If its an abstract class then it should be prefixed just as interfaces should be appended with interface as per PSR. https://www.php-fig.org/bylaws/psr-naming-conventions/

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 2 days ago
            Resolved by Guy Thouret 2 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 2 days ago
            Resolved by Guy Thouret 2 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 2 days ago
            Resolved by Guy Thouret 2 days ago
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 2 days ago
            Resolved by Guy Thouret 1 day ago
          • Guy Thouret @gthouret added 1 commit 2 days ago

            added 1 commit

            • e131e830 - Refactor Boost Code - #1149

            Compare with previous version

          • Guy Thouret
            Guy Thouret @gthouret · 2 days ago
            Developer

            I added the requested docblocks. They don't seem to add any value over the stuff I'd already documented. The methods are self documenting. I'm literally just repeating what the method already says over and over again unless I'm missing something.

          • Guy Thouret @gthouret added 1 commit 2 days ago

            added 1 commit

            • 0a443c1c - Refactor Boost Code - #1149

            Compare with previous version

          • Guy Thouret
            Guy Thouret @gthouret · 2 days ago
            Developer

            @markeharding Did I understand what we discussed about the counters correctly in this last change?

          • Guy Thouret @gthouret mentioned in issue #1134 2 days ago

            mentioned in issue #1134

          • Brian Hatchet
            Brian Hatchet :speech_balloon: @brianhatchet · 1 day ago
            Developer

            @markeharding is going to re-review this and we'll get it merged in

          • Brian Hatchet :speech_balloon: @brianhatchet assigned to @markeharding 1 day ago

            assigned to @markeharding

          • Guy Thouret
            Guy Thouret @gthouret · 14 hours ago
            Developer

            My tests so far:

            • Boosts appear in rotator
            • Boosts appear in sidebar
            • Can create a newsfeed boost
            • Can create a sidebar boost
            • Can send a boost offer to another channel
            • Can receive and accept a boost offer from another channel
            • Can revoke a boost
            Edited by Guy Thouret 3 hours ago
          • Guy Thouret
            Guy Thouret @gthouret · 14 hours ago
            Developer

            Awaiting @benhayward.ben response as boost offer was sent to him.

          • Guy Thouret
            Guy Thouret @gthouret · 14 hours ago
            Developer

            Creating a sidebar boost emits the following log notice, though it does complete successfully.

            2019/12/06 00:32:28 [error] 8#8: *342 FastCGI sent in stderr: "PHP message: Attribute handler is not defined in Minds\Core\Boost\Network\Boost (getHandler)PHP message: Attribute handler is not defined in Minds\Core\Boost\Network\Boost (getHandler)PHP message: Attribute handler is not defined in Minds\Core\Boost\Network\Boost (getHandler)PHP message: Attribute handler is not defined in Minds\Core\Boost\Network\Boost (getHandler)" while reading response header from upstream, client: 192.168.13.110, server: _, request: "POST /api/v2/boost/user/996163850711601168/0 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "feat-1149-boost-refactor.minds.io", referrer: "https://feat-1149-boost-refactor.minds.io/newsfeed/subscriptions"
            • Guy Thouret
              Guy Thouret @gthouret · 14 hours ago
              Developer

              On first load, the GET request for the sidebar content emits the following:

              2019/12/06 00:21:34 [error] 8#8: *15 FastCGI sent in stderr: "PHP message: Exception #1575591694: TypeError: Argument 1 passed to Minds\Core\Boost\Network\Iterator::setOffset() must be of the type int, string given, called in /var/www/Minds/engine/Controllers/api/v1/boost/fetch.php on line 58 and defined in /var/www/Minds/engine/Core/Boost/Network/Iterator.php:57
              Stack trace:
              #0 /var/www/Minds/engine/Controllers/api/v1/boost/fetch.php(58): Minds\Core\Boost\Network\Iterator->setOffset('')
              #1 /var/www/Minds/engine/Api/Factory.php(87): Minds\Controllers\api\v1\boost\fetch->get(Array)
              #2 /var/www/Minds/engine/Controllers/api/api.php(76): Minds\Api\Factory::build(Array, Object(Zend\Diactoros\ServerRequest), Object(Zend\Diactoros\Response\JsonResponse))
              #3 /var/www/Minds/engine/Core/Router.php(157): Minds\Controllers\api\api->get(Array)
              #4 /var/www/Minds/engine/index.php(9): Minds\Core\Router->route()
              #5 {main}" while reading response header from upstream, client: 192.168.13.110, server: _, request: "GET /api/v1/boost/fetch/content?limit=8&offset=&rating=2 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "feat-1149-boost-refactor.minds.io", referrer: "https://feat-1149-boost-refactor.minds.io/newsfeed/subscriptions"
            • Collapse replies
            • Mark Harding
              Mark Harding @markeharding · 8 hours ago
              Owner

              Guids are strings or else JS will round them up.

            • Please register or sign in to reply
          • Guy Thouret @gthouret added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label 14 hours ago

            added scoped label and automatically removed label

          • Guy Thouret @gthouret added 1 commit 14 hours ago

            added 1 commit

            • cfe70dfa - Refactor Boost Code - #1149

            Compare with previous version

          • Guy Thouret
            Guy Thouret @gthouret · 13 hours ago
            Developer

            Last fix for the sidebar content just causes the request to time out now. :rolling_eyes:

            2019/12/06 01:13:26 [error] 8#8: *111 upstream timed out (110: Operation timed out) while reading response header from upstream, client: 192.168.13.110, server: _, request: "GET /api/v1/boost/fetch/content?limit=8&offset=&rating=2 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "feat-1149-boost-refactor.minds.io", referrer: "https://feat-1149-boost-refactor.minds.io/newsfeed/subscriptions"
            
            [06-Dec-2019 01:14:26] WARNING: [pool www] child 11, script '/var/www/Minds/engine/index.php' (request: "GET /index.php?limit=8&offset=&rating=2") execution timed out (120.331320 sec), terminating
            [06-Dec-2019 01:14:26] WARNING: [pool www] child 11 exited on signal 15 (SIGTERM) after 397.361877 seconds from start
          • Guy Thouret @gthouret added 1 commit 4 hours ago

            added 1 commit

            • 6a902a4c - Refactor Boost Code - #1149

            Compare with previous version

          • Guy Thouret
            Guy Thouret @gthouret · 4 hours ago
            Developer

            Tests are failing for payment. Tests are invalid anyway as the type of the object passed in the Payment tests is not the type of object passed in the API calls.

            Guessing the payment stuff was written for first iteration of boost objects (Entities\Boost\...) and not what is in use (Core\Boost\...).

            Just when I thought I had a handle on Boost, some more danger has presented itself.

            It's not clear now what parts of boost are using old and what's using new, what is dead code, what is not.

            I'm going to need to assign some time to this if we want to get it out with any kind of confidence.

          • Guy Thouret
            Guy Thouret @gthouret · 4 hours ago
            Developer

            I'm either missing a piece of the puzzle or something has gone very wrong at some point with the development of boost.

          • Guy Thouret
            Guy Thouret @gthouret · 4 hours ago
            Developer

            @markeharding @brianhatchet The saga continues, see the above comments. It would great if you could shed any light on this.

          • Guy Thouret @gthouret added 1 commit 4 hours ago

            added 1 commit

            • e4967603 - Refactor Boost Code - #1149

            Compare with previous version

          • Guy Thouret
            Guy Thouret @gthouret · 4 hours ago
            Developer

            Pushed a hack for Payments to properly handle both sets of Boost object for now.

          • Guy Thouret
            Guy Thouret @gthouret · 3 hours ago
            Developer

            Revoking a boost returns {status: "error"}

            Request URL: https://feat-1149-boost-refactor.minds.io/api/v2/boost/newsfeed/1049474072058007557/revoke
            Request Method: DELETE
          • Guy Thouret @gthouret added 1 commit 3 hours ago

            added 1 commit

            • 079a3e91 - Boost revoke should return exception message - #1149

            Compare with previous version

          • Mark Harding
            Mark Harding @markeharding · 2 hours ago
            Owner

            If this isn't ready to be merged in anymore then we should put back to WIP.

          • Guy Thouret @gthouret marked as a Work In Progress 1 hour ago

            marked as a Work In Progress

          • Guy Thouret
            Guy Thouret @gthouret · 28 minutes ago
            Developer

            Ben sees the peer boost request in inbox with now way of accepting. @markeharding Any insight into how that is supposed to work and if it's actually functional in production?

            pasted_image

          • Bill Ottman
            Bill Ottman :dragon_face: @ottman · 6 minutes ago
            Developer

            I just confirmed this works in production with @jotto141

          Please register or sign in to reply
          Assignee
          Mark Harding's avatar
          Mark Harding @markeharding
          Boost Refactor #mvp
          Milestone
          Boost Refactor #mvp
          Time tracking
          No estimate or time spent
          2
          Labels
          MR::Requires Changes Squad::Blue
          Lock merge request
          Unlocked
          12
          12 participants
          user avatar
          Rami Albatal
          user avatar
          Marcelo Rivera
          user avatar
          Mark Harding
          user avatar
          Emiliano Balbuena
          user avatar
          Brian Hatchet
          user avatar
          Olivia Madrid
          user avatar
          Ben Hayward
          Reference: minds/engine!410