Fix region-id query issue #697
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By applying the encodeURIComponent, it is possible for the query to receive the value "SW#{sellerId}" in base64, which allows segmenting the catalog by region-id.
What problem is this solving?
I'm trying to segment the catalog displayed in the PLP by region-id. However, when passing the value "SW#{sellerId}" converted to base64 as the value of the selectedFacet "region-id", an error occurs, since this value is sent to MetadataSearchV3, which in turn does not accept the equal symbol ("=").
How to test it?
Access one of the following workspaces and compare its total products number to a GraphQL Query that does the same query and segmentation.
Query:
http://poclistallfreights--electrolux.myvtex.com/outlet-sao-paulo
http://poclistallfreights--electrolux.myvtex.com/outlet-brasilia
http://poclistallfreights--electrolux.myvtex.com/outlet-manaus
http://poclistallfreights--electrolux.myvtex.com/outlet-belo-horizonte
http://poclistallfreights--electrolux.myvtex.com/outlet-barigui
http://poclistallfreights--electrolux.myvtex.com/outlet-campo-largo
http://poclistallfreights--electrolux.myvtex.com/outlet-porto-belo
http://poclistallfreights--electrolux.myvtex.com/outlet-cajuru
http://poclistallfreights--electrolux.myvtex.com/outlet-florianopolis
http://poclistallfreights--electrolux.myvtex.com/outlet-feira-de-santana
http://poclistallfreights--electrolux.myvtex.com/outlet-salvador
http://poclistallfreights--electrolux.myvtex.com/outlet-sao-roque
Screenshots or example usage:
Describe alternatives you've considered, if any.
If you pass any string other then the "SW#{sellerId}" you'll receive a result with products, but it is a "false positive", that's why it is important to compare the results to the GraphQL Query.
Related to / Depends on
There is a VTEX Support Ticket related to this same issue (1187628).
How does this PR make you feel? 🔗
