Skip to content

[Issue] Added getScopeCacheKey in order to define the right cache key based on store ID #28142

Open
@ghost

Description

This issue is automatically created based on existing pull request: #27142: Added getScopeCacheKey in order to define the right cache key based on store ID


Description (*)

This PR adds an small improvement to the instance cache into the categories repository cause it allows to receive store id or store code for attributes data retrieval but at the same time this store id / code is used as cache key which make it a double unnecessary category load when you request the category by same given store, first providing the store id and then providing store code.

Manual testing scenarios (*)

  1. Into your own class load the category repository via di.
  2. Use the category repository to get a given category providing an specific store ID. Check the given category got stored into the cached instances array of the repository under the store ID.
  3. Use the category repository to get a given category (same category as previous point) providing a specific store Code (same store as previous point). Error should be thrown with this fix, otherwise it was loading again the category filtering by store code which is incorrect based on PHP Docs into the interface.

Questions or comments

Have in mind this issue is not reproducible from REST API given it enforces to use the store ID based on the PHP Docs from the interface.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Metadata

Assignees

Labels

Component: CatalogIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failedPriority: P4No current plan to fix. Fixing can be deferred as a logical part of more important work.Progress: PR in progressSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions