Bug in generating keys for Redis.
Hi I'm working on implmentation of FactFinder in spryker system.
I found out that sku that gets returned from FactFinder is used to generate redis key. With that redis key we are querying redis to get the data.
Method in ProductAbstractStorageReader class(vendor/spryker/product-storage/src/Spryker/Client/ProductStorage/Storage/ProductAbstractStorageReader.php) called "findProductAbstractStorageDataByMapping".
That method is called in my case fro 10 places:
As picture suggest those are all bridges from some glue API. Method has first parameter "MAPPING TYPE".
If I go to see what value does $mappingType have it is always "sku"
The method "findProductAbstractStorageDataByMapping" generates $reference
$reference = $mappingType . ':' . $identifier;
Identifier is SKU of product. Let's take some sku. For example i have sku "M100000068" for one abstract product.
$reference = "sku" . ":" . "M100000068";
So result is "sku:M100000068"
Key generation in redis has some rules and are defined in xml file.
Key is build like:
resource, store, locale, key_suffix_column
Example: product_abstract:de:de_de:515
Since glue apis and FactFinder are concatenating reference as "sku" . ":" . "[sku_number]" that reference would never match any of the keys in redis since keys in redis have different logic of generation.
When i call FactFinder or any GLUE apis that were mentioned in bridges in picture above.
They will generate key like:
"product_abstract:de:de_de:sku:sku:M100000068"
And all keys in redis will look like.
product_abstract:de:de_de:515
All of that being said. I can not see a way for this to work. Is this a known bug? Or am I missing something?
Comments
-
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,075 ⚖️ - Guardians (admin)
Closed because of duplicate :)
1
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 75 Spryker News
- 920 Developer Corner
- 780 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 25 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random