Skip to content

[Issue] There is a plugin add this data when loading a customer group #40454

@JeroenBoersma

Description

@JeroenBoersma

Preconditions and environment

Follow up for #38043 as the proposed solution is declined and the related issue got closed after 3 years.

Issue

The customer group caches data to make sure that not too re-use the data, because this is a plugin this will fire many queries to the database fetching the same data.

Description (*)

\Magento\Customer\Api\GroupRepositoryInterface::getById has a plugin \Magento\Customer\Model\Plugin\GetByIdCustomerGroupExcludedWebsite::afterGetById which will add the excluded groups to the customer groups as extension attributes. Every customer group getById() will do a extra database request. This will re-use the existing data without querying the database again, the data itself is pretty small, which will serve from memory in the next requests.
Related Pull Requests

Fixed Issues (if relevant)

Ran into it working on a project.

Manual testing scenarios (*)

I came along 400 something queries in the frontend on a grouped project page, this adds a 500ms on pageload.

Questions or comments

The customer group uses the same principal in the repository to cache the data.

Related MR

Steps to reproduce

Navigate to a category page.

Expected result

Have it load 500ms faster

Actual result

It is 500ms slower

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: ready for confirmationReported on 2.4.xIndicates original Magento version for the Issue report.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    Status

    Ready for Confirmation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions