Skip to content

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

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

Extract record view details from analytics/views api call

The details of recording a view are hidden away inside the api call.

These details should be in a class (or set of classes) within the code base and be subject to testing with the API left to do it's job of parameter parsing and error handling.

The motivation for this refactor is the ongoing boost improvements. A critical piece of boost functionality that marks a boost as expired has been hidden away inside this seemingly unrelated API call.

Closes #1077

Testing Steps:

  • Scroll down newsfeed
  • Make a note of the view counters
  • Wait an indeterminate amount of time (Counters are stored on the entity within ES?)
  • Refresh page
  • The view counters should have increased by 1
Edited 5 days ago by Guy Thouret
Request to merge extract-view-api-1077 into epic/boost-campaign
The source branch is 29 commits behind the target branch
Open in Web IDE
Pipeline #101844703 passed for 65285097 on extract-view-api-1077
          Requires 3 more approvals from Devs, Deployers, and QA.
          Brian Hatchet
          Brian Hatchet
          Emiliano Balbuena
          Emiliano Balbuena
          Mark Harding
          Mark Harding
          Olivia Madrid
          Olivia Madrid
          Ben Hayward
          Ben Hayward
          There are merge conflicts. Resolve these conflicts or ask someone with write access to this repository to merge it locally
          You can merge this merge request manually using the
          • Discussion 12
          • Commits 2
          • Pipelines 5
          • Changes 5
          3/4 threads resolved
          • Guy Thouret @gthouret added MR::Awaiting Review Product::Analytics Squad::Blue Type::Refactor scoped labels 1 week ago

            added scoped labels

          • Guy Thouret @gthouret changed the description 1 week ago

            changed the description

          • Guy Thouret @gthouret added 1 commit 1 week ago

            added 1 commit

            • eb34ad78 - Extract record view details from analytics/views api call - #1077

            Compare with previous version

          • Guy Thouret @gthouret added 1 commit 1 week ago

            added 1 commit

            • cebc9837 - Extract record view details from analytics/views api call - #1077

            Compare with previous version

          • Guy Thouret
            Guy Thouret @gthouret · 1 week ago
            Developer

            More regression...

            2019/12/04 15:36:51 [error] 9#9: *65 FastCGI sent in stderr: "PHP message: Exception #1575473811: TypeError: Return value of Minds\Core\Analytics\Views\Record::recordEntity() must be of the type bool, none returned in /var/www/Minds/engine/Core/Analytics/Views/Record.php:144
            Stack trace:
            #0 /var/www/Minds/engine/Controllers/api/v2/analytics/views.php(37): Minds\Core\Analytics\Views\Record->recordEntity()
            #1 /var/www/Minds/engine/Api/Factory.php(87): Minds\Controllers\api\v2\analytics\views->post(Array)
            #2 /var/www/Minds/engine/Controllers/api/api.php(81): 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->post(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: "POST /api/v2/analytics/views/activity/1041704347395690512 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "extract-view-api-1077.minds.io", referrer: "https://extract-view-api-1077.minds.io/newsfeed/subscriptions"
          • Guy Thouret
            Guy Thouret @gthouret · 1 week ago
            Developer

            Also...

            2019/12/04 15:37:08 [error] 9#9: *65 FastCGI sent in stderr: "PHP message: Attribute rejectReason is not defined in Minds\Core\Boost\Network\Boost (setRejectReason)" while reading response header from upstream, client: 192.168.13.110, server: _, request: "POST /api/v2/analytics/views/boost/1018217353512488976 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "extract-view-api-1077.minds.io", referrer: "https://extract-view-api-1077.minds.io/newsfeed/subscriptions"
          • Guy Thouret
            Guy Thouret @gthouret · 1 week ago
            Developer

            Objects of type Minds\Core\Boost\Network\Boost are what is read but the functions we pass that object to are actually expecting an object of type Minds\Entities\Boost\Network :thinking:

          • Guy Thouret
            Guy Thouret @gthouret · 1 week ago
            Developer

            This is a lift and shift of original functionality. We have two objects declared for the same thing??? I'm confused now.

          • Guy Thouret
            Guy Thouret @gthouret · 1 week ago
            Developer

            Minds\Entities\Boost\Network has a setRejectionReason method. Somebody made a typo with setRejectReason and this has never been caught????

          • Guy Thouret
            Guy Thouret @gthouret · 1 week ago
            Developer

            Should be setRejectedReason. Was being set by Boost\Network\Repository so never worked since that file was created.

          • Guy Thouret @gthouret added 1 commit 1 week ago

            added 1 commit

            • 6cefab06 - Extract record view details from analytics/views api call - #1077

            Compare with previous version

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

            unmarked as a Work In Progress

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

              Needs testing instructions. How can I verify this?

            • Please register or sign in to reply
          • Brian Hatchet :speech_balloon: @brianhatchet assigned to @gthouret 5 days ago

            assigned to @gthouret

          • Guy Thouret @gthouret changed the description 5 days ago

            changed the description

          • Guy Thouret @gthouret changed the description 5 days ago

            changed the description

          • Guy Thouret @gthouret changed the description 5 days ago

            changed the description

          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 5 days ago
            Resolved by Guy Thouret 1 day ago
          • Mark Harding
            Mark Harding @markeharding started a thread on an old version of the diff 5 days ago
            Resolved by Guy Thouret 1 day ago
          • Mark Harding @markeharding added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label 5 days ago

            added scoped label and automatically removed label

            • Brian Hatchet
              Brian Hatchet :speech_balloon: @brianhatchet · 2 days ago
              Developer
              Resolved by Guy Thouret 1 day ago

              @gthouret this needs to be pointed at the new epic you're creating for the boost refactor test site.

            • Guy Thouret
              Guy Thouret
              Last reply by Guy Thouret 1 day ago
          • Guy Thouret @gthouret added 1 commit 1 day ago

            added 1 commit

            • 65285097 - Add phpdocs and move referral cookie instantiation to constructor - #1077

            Compare with previous version

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

            changed target branch from master to epic/boost-campaign

          • Guy Thouret @gthouret added MR::Awaiting Review scoped label and automatically removed MR::Requires Changes label 1 day ago

            added scoped label and automatically removed label

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

            @gthouret there are merge conflicts.

          • Brian Hatchet :speech_balloon: @brianhatchet added Status::Requires Changes scoped label and automatically removed Status::Awaiting Review label 5 minutes ago

            added scoped label and automatically removed label

          • Brian Hatchet :speech_balloon: @brianhatchet added Sprint::12/11 - Understood Unicorn scoped label 5 minutes ago

            added scoped label

          Please register or sign in to reply
          Assignee
          Guy Thouret's avatar
          Guy Thouret @gthouret
          None
          Milestone
          None
          Time tracking
          No estimate or time spent
          5
          Labels
          Product::Analytics Sprint::12/11 - Understood Unicorn Squad::Blue Status::Requires Changes Type::Refactor
          Lock merge request
          Unlocked
          10
          10 participants
          user avatar
          Brian Hatchet
          user avatar
          Emiliano Balbuena
          user avatar
          Mark Harding
          user avatar
          Olivia Madrid
          user avatar
          Ben Hayward
          user avatar
          Rami Albatal
          user avatar
          Martin Santangelo
          Reference: minds/engine!413