Skip to content

Fix region-id query issue #697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Marcelo-Diament
Copy link

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:

productSearch(selectedFacets: [{key: "region-id", value: "U1cjb3V0bGV0ZWx1eGJyMDE="}], hideUnavailableItems: true) {
    recordsFiltered
}

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:

seller-catalog-from-search-result-query-quantidades-01-sao-paulo
seller-catalog-from-search-result-query-quantidades-02-brasilia
seller-catalog-from-search-result-query-quantidades-03-manaus
seller-catalog-from-search-result-query-quantidades-04-belo-horizonte
seller-catalog-from-search-result-query-quantidades-05-barigui
seller-catalog-from-search-result-query-quantidades-06-campo-largo
seller-catalog-from-search-result-query-quantidades-07-porto-belo
seller-catalog-from-search-result-query-quantidades-08-cajuru
seller-catalog-from-search-result-query-quantidades-09-florianopolis
seller-catalog-from-search-result-query-quantidades-10-feira-de-santana
seller-catalog-from-search-result-query-quantidades-11-salvador
seller-catalog-from-search-result-query-quantidades-12-sao-roque
seller-catalog-from-search-result-query-quantidades-corretas

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? 🔗

![https://media.giphy.com/media/erwW0QPCDN5QOe0BA1/giphy.gif?cid=82a1493bclj6txef3ndaa8kk2ie8h8734h0689u4f6hy9mxs&ep=v1_gifs_trending&rid=giphy.gif&ct=g](please help me)

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.
@Marcelo-Diament Marcelo-Diament requested review from a team as code owners March 24, 2025 22:23
@Marcelo-Diament Marcelo-Diament requested review from vsseixaso, RodrigoTadeuF and leo-prange-vtex and removed request for a team March 24, 2025 22:23
Copy link
Contributor

vtex-io-ci-cd bot commented Mar 24, 2025

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

@vtex-io-docs-bot
Copy link

Beep boop 🤖

I noticed you didn't make any changes at the docs/ folder

  • There's nothing new to document 🤔
  • I'll do it later 😞

In order to keep track, I'll create an issue if you decide now is not a good time

  • I just updated 🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant