Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • Sign in / Register
Minds Backend - Engine
Minds Backend - Engine
  • Project overview
  • Repository
  • Issues 286
  • 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

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

Refactor Boost Code

Closes #1149

Edited 2 hours ago by Guy Thouret
Request to merge feat/1149-boost-refactor into epic/boost-campaign
Pipeline #101842256 passed for 6112fcf4 on feat/1149-boost-refactor
          Requires 3 more approvals from Devs, Deployers, and QA.
          Brian Hatchet
          Brian Hatchet
          Rami Albatal
          Rami Albatal
          Emiliano Balbuena
          Emiliano Balbuena
          Marcelo Rivera
          Marcelo Rivera
          Ben Hayward
          Ben Hayward

          Merged by Guy Thouret 2 hours ago

          The changes were merged into epic/boost-campaign with 2a794180

          Pipeline #101842954 passed for 2a794180 on epic/boost-campaign
                  • Discussion 33
                  • Commits 2
                  • Pipelines 13
                  • Changes 56
                  6/7 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 1 week ago

                    added 1 commit

                    • cd72577e - Refactor Boost Code - #1149

                    Compare with previous version

                  • Guy Thouret @gthouret added 1 commit 1 week ago

                    added 1 commit

                    • e7269ef5 - Refactor Boost Code - #1149

                    Compare with previous version

                  • Guy Thouret @gthouret added 1 commit 1 week ago

                    added 1 commit

                    • 6efd9e52 - Refactor Boost Code - #1149

                    Compare with previous version

                  • Guy Thouret @gthouret added 1 commit 1 week ago

                    added 1 commit

                    • 722e6865 - Refactor Boost Code - #1149

                    Compare with previous version

                  • Guy Thouret @gthouret unmarked as a Work In Progress 1 week ago

                    unmarked as a Work In Progress

                  • Mark Harding
                    Mark Harding @markeharding started a thread on an old version of the diff 6 days ago
                    Resolved by Guy Thouret 2 hours ago
                  • Mark Harding
                    Mark Harding @markeharding started a thread on an old version of the diff 6 days ago
                    Resolved by Guy Thouret 5 days ago
                  • Mark Harding
                    Mark Harding @markeharding started a thread on the diff 6 days ago
                    Resolved by Guy Thouret 5 days ago
                  • Mark Harding
                    Mark Harding @markeharding started a thread on the diff 6 days ago
                    Resolved by Guy Thouret 5 days ago
                  • Mark Harding
                    Mark Harding @markeharding started a thread on the diff 6 days ago
                    Resolved by Guy Thouret 5 days ago
                  • Guy Thouret @gthouret added 1 commit 5 days ago

                    added 1 commit

                    • e131e830 - Refactor Boost Code - #1149

                    Compare with previous version

                  • Guy Thouret
                    Guy Thouret @gthouret · 5 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 5 days ago

                    added 1 commit

                    • 0a443c1c - Refactor Boost Code - #1149

                    Compare with previous version

                  • Guy Thouret
                    Guy Thouret @gthouret · 5 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 5 days ago

                    mentioned in issue #1134

                  • Brian Hatchet
                    Brian Hatchet :speech_balloon: @brianhatchet · 5 days ago
                    Developer

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

                  • Brian Hatchet :speech_balloon: @brianhatchet assigned to @markeharding 5 days ago

                    assigned to @markeharding

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

                    My tests so far:

                    • Boosts appear in rotator
                    • Boosts appear in sidebar
                    • Can create a newsfeed boost (onchain)
                    • Can create a sidebar boost (onchain)
                    • Can send a boost offer to another channel (onchain)
                    • Can receive and accept a boost offer from another channel (onchain)
                    • Can revoke a boost (onchain)
                    • Can create a newsfeed boost (offchain)
                    • Can create a sidebar boost (offchain)
                    • Can send a boost offer to another channel (offchain)
                    • Can receive and accept a boost offer from another channel (offchain)
                    • Can revoke a boost (offchain)
                    Edited by Guy Thouret 3 days ago
                  • Guy Thouret
                    Guy Thouret @gthouret · 4 days ago
                    Developer

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

                  • Guy Thouret
                    Guy Thouret @gthouret · 4 days 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 · 4 days ago
                      Developer
                      Resolved by Guy Thouret 2 hours ago

                      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"
                    • Mark Harding
                      Mark Harding
                      Guy Thouret
                      Guy Thouret
                      Last reply by Guy Thouret 2 hours ago
                  • Guy Thouret @gthouret added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label 4 days ago

                    added scoped label and automatically removed label

                  • Guy Thouret @gthouret added 1 commit 4 days ago

                    added 1 commit

                    • cfe70dfa - Refactor Boost Code - #1149

                    Compare with previous version

                  • Guy Thouret
                    Guy Thouret @gthouret · 4 days 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 3 days ago

                    added 1 commit

                    • 6a902a4c - Refactor Boost Code - #1149

                    Compare with previous version

                  • Guy Thouret
                    Guy Thouret @gthouret · 3 days 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 · 3 days 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 · 3 days 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 3 days ago

                    added 1 commit

                    • e4967603 - Refactor Boost Code - #1149

                    Compare with previous version

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

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

                  • Guy Thouret
                    Guy Thouret @gthouret · 3 days 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 days ago

                    added 1 commit

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

                    Compare with previous version

                  • Mark Harding
                    Mark Harding @markeharding · 3 days 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 3 days ago

                    marked as a Work In Progress

                  • Guy Thouret
                    Guy Thouret @gthouret · 3 days 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 · 3 days ago
                    Developer

                    I just confirmed this works in production with @jotto141

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

                    Ok, I'll try and boost between a couple accounts in sandbox myself to iron out the issue.

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

                    Expanding on the revoke error: {"status":"error","message":"This boost is in the revoked state and cannot be refunded"}

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

                    Offchain offer are working fine in sandbox. On chain are not, though this appears to be a limitation of sandbox env.

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

                    Offchain revoke ok

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

                    Boost Iterator is sitting in an infinite loop at line 114 while ($this->fetchMore).

                    Needs a circuit breaker to prevent this.

                  • Guy Thouret @gthouret added 1 commit 3 days ago

                    added 1 commit

                    • 58c6b07b - Refactor Boost Code - #1149

                    Compare with previous version

                    • Brian Hatchet
                      Brian Hatchet :speech_balloon: @brianhatchet · 8 hours ago
                      Developer

                      Needs to be assigned to a boost refactor epic

                    • Please register or sign in to reply
                  • Guy Thouret @gthouret added 1 commit 2 hours ago

                    added 1 commit

                    • 6112fcf4 - Rename Boost\Feed to Boost\AbstractFeed - #1149

                    Compare with previous version

                  • Guy Thouret @gthouret unmarked as a Work In Progress 2 hours ago

                    unmarked as a Work In Progress

                  • Guy Thouret @gthouret changed target branch from master to epic/boost-campaign 2 hours ago

                    changed target branch from master to epic/boost-campaign

                  • Guy Thouret @gthouret merged 2 hours ago

                    merged

                  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
                  Brian Hatchet
                  user avatar
                  Rami Albatal
                  user avatar
                  Emiliano Balbuena
                  user avatar
                  Marcelo Rivera
                  user avatar
                  Ben Hayward
                  user avatar
                  Mark Harding
                  user avatar
                  Martin Santangelo
                  Reference: minds/engine!410