Repository navigation
feat: Update Session with location info - #2749
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
92e616f to
86d6dae
Compare
d9b57ce to
1686b6b
Compare
3825b3c to
9742ded
Compare
1686b6b to
2430cf9
Compare
| return null | ||
| } | ||
|
|
||
| await updateSessionWithLocation(clients, newSession, enableDeliveryPromise) |
There was a problem hiding this comment.
Lari, vendo a implementação e também a doc de sessions fiquei com a percepção que a implementação pode ser mais sofisticada para ser otimizada tbm, então alguns pontos:
- A definição do
newSessionnão deveria incluir também opostalCodepara todos esses parametros serem considerados nodeepEquals? - Na linha 120 o client de session tem o
paramsque se você adicionar esses 3 novos campos nele, mesmo indo como query string eles vão fazer parte do public então o create da session já volta com eles sem precisar do update depois - Outro ponto sobre esse client da linha 120, ele sempre faz POST mas de acordo com a doc se ja temos os cookies setados na request parece que seria ideal ele ter uma logica de fazer PATCH, dessa forma vc não precisaria de um novo client e toda atualização ja aconteceria ali naquele momento
- A app checkout-session já implementa a logica de setar o
regionIdbaseado no recebimento dopostalCode, country, geoCoordinatesentão acho que podemos remover a implementação da linha 112 a 119 eliminando mais uma request desse fluxo - essa app do checkout parece tbm ja setar endereço baseado no cliente logado que pelo que entendi seria uma outra task de vocês
There was a problem hiding this comment.
Oie, pala! Obrigada pelos pontos levantados!
1 - postalCode é incluído no newSession pelo ...oldSession da linha 131
2 e 3 - boa ideia!! Vou dar uma analisada nisso agora
4 - Interessante! Para esse ponto vou criar uma task no board do time para não misturar muito as coisas nesse PR.
5 - Sim, foi feita uma lógica para pegarmos o endereço salvo do shopper (PR), vou criar uma task no nosso épico de Delivery Promise para analisarmos isso também, se seria possível utilizar o que checkout já está fazendo para simplificarmos!
There was a problem hiding this comment.
4 - Atualizei para que a gente pegue o regionId através da session aqui, mas para poder eliminar a necessidade dessa request para o checkout também precisamos analisar essa questão dos sellers que é outra info que estamos recebendo através dessa request e que não recebemos por session. Task criada sobre isso aqui.
5 - Conforme conversamos por DM, infelizmente não temos o necessário através de checkout para eliminarmos a necessidade da request para pegar os endereços salvos através da API de profile system, portanto como já validamos essa questão, não vou criar uma task sobre isso.
## What's the purpose of this pull request? The PR #2749 introduced a bug: when the store doesn't have the Delivery Promise feature enabled, the channel `regionId` wasn't being updated. ## How it works? The Checkout updates the session's `regionId` when we update the session to add info about `geoCoordinates`, `country`, and `postalCode`. But we were only doing that when the Delivery Promise feature was enabled. This conditional was removed. For the `sellers` info that we get from Checkout request, we only need to make this request if there is a `seller` info inside the `channel`. So a conditional was introduced to reduce the need of making this request every time. ## How to test it? Check it with Delivery Promise enabled and disabled. On both flows the session in the IndexedDB should be updated to add `regionId` inside the channel when a `postalCode` is added in the RegionBar. To check the `seller` info: an option is changing the config inside `discovery.config`: `channel: '{"salesChannel":"1","regionId":"","hasOnlyDefaultSalesChannel":"true", "seller":"storeframework01"}',` and also set a `postalCode` there: `postalCode: '90210',` The session in the IndexedDB should contain the valid seller (example: `storeframework01`) inside the channel if it was added (in config, for example). ### Starters Deploy Preview <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> ## References <!--- Spread the knowledge: is there any content you used to create this PR that is worth sharing? ---> <!--- Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process --->
## What's the purpose of this pull request? Update the Session with postal code, country, and geo-coordinates. The Intelligent Search will use this for the Delivery Promise feature. FastStore updates the session with the location information and IS access it. ## How it works? The update is a PATCH request to the Session Manager API. The fields that IS will use from the session are `postalCode`, `geoCoordinates` and `country`, inside the `public` namespace. ## How to test it? Run this code (or use the preview link below) and test changing the postal code and/or using a default one. The fields inside public namespace of the session should be updated accordingly. To check it you can run this request: ```curl curl --location 'https://storeframework.vtexcommercestable.com.br/api/sessions?items=public.postalCode,public.geoCoordinates,public.country' \ --header 'Cookie: vtex_session=ADD_HERE' ```⚠️ Substitute the "ADD_HERE" with the vtex_session cookie that you can get in the browser #### Preview with Delivery Promise NOT enabled https://storeframework-cm652ufll028lmgv665a6xv0g-lqicw1ez2.b.vtex.app/ The session shouldn't update the public field.   #### Preview with Delivery Promise enabled https://storeframework-cm652ufll028lmgv665a6xv0g-58v0e6a7h.b.vtex.app/ ##### Without postal code set The session shouldn't update the public field.   ##### With postal code (and country and geo coordinates) The session should update the public field!   ### Starters Deploy Preview https://github.com/vtex-sites/starter.store/pull/737 ## References - [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2362) - [Slack thread](https://vtex.slack.com/archives/C069YM7R73P/p1741962308203469?thread_ts=1741782251.679469&cid=C069YM7R73P) - [Session Manager API - Edit session](https://developers.vtex.com/docs/api-reference/session-manager-api#patch-/api/sessions)
## What's the purpose of this pull request? The PR #2749 introduced a bug: when the store doesn't have the Delivery Promise feature enabled, the channel `regionId` wasn't being updated. ## How it works? The Checkout updates the session's `regionId` when we update the session to add info about `geoCoordinates`, `country`, and `postalCode`. But we were only doing that when the Delivery Promise feature was enabled. This conditional was removed. For the `sellers` info that we get from Checkout request, we only need to make this request if there is a `seller` info inside the `channel`. So a conditional was introduced to reduce the need of making this request every time. ## How to test it? Check it with Delivery Promise enabled and disabled. On both flows the session in the IndexedDB should be updated to add `regionId` inside the channel when a `postalCode` is added in the RegionBar. To check the `seller` info: an option is changing the config inside `discovery.config`: `channel: '{"salesChannel":"1","regionId":"","hasOnlyDefaultSalesChannel":"true", "seller":"storeframework01"}',` and also set a `postalCode` there: `postalCode: '90210',` The session in the IndexedDB should contain the valid seller (example: `storeframework01`) inside the channel if it was added (in config, for example). ### Starters Deploy Preview <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> ## References <!--- Spread the knowledge: is there any content you used to create this PR that is worth sharing? ---> <!--- Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process --->
## What's the purpose of this pull request? Update the Session with postal code, country, and geo-coordinates. The Intelligent Search will use this for the Delivery Promise feature. FastStore updates the session with the location information and IS access it. ## How it works? The update is a PATCH request to the Session Manager API. The fields that IS will use from the session are `postalCode`, `geoCoordinates` and `country`, inside the `public` namespace. ## How to test it? Run this code (or use the preview link below) and test changing the postal code and/or using a default one. The fields inside public namespace of the session should be updated accordingly. To check it you can run this request: ```curl curl --location 'https://storeframework.vtexcommercestable.com.br/api/sessions?items=public.postalCode,public.geoCoordinates,public.country' \ --header 'Cookie: vtex_session=ADD_HERE' ```⚠️ Substitute the "ADD_HERE" with the vtex_session cookie that you can get in the browser #### Preview with Delivery Promise NOT enabled https://storeframework-cm652ufll028lmgv665a6xv0g-lqicw1ez2.b.vtex.app/ The session shouldn't update the public field.   #### Preview with Delivery Promise enabled https://storeframework-cm652ufll028lmgv665a6xv0g-58v0e6a7h.b.vtex.app/ ##### Without postal code set The session shouldn't update the public field.   ##### With postal code (and country and geo coordinates) The session should update the public field!   ### Starters Deploy Preview https://github.com/vtex-sites/starter.store/pull/737 ## References - [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2362) - [Slack thread](https://vtex.slack.com/archives/C069YM7R73P/p1741962308203469?thread_ts=1741782251.679469&cid=C069YM7R73P) - [Session Manager API - Edit session](https://developers.vtex.com/docs/api-reference/session-manager-api#patch-/api/sessions)
## What's the purpose of this pull request? The PR #2749 introduced a bug: when the store doesn't have the Delivery Promise feature enabled, the channel `regionId` wasn't being updated. ## How it works? The Checkout updates the session's `regionId` when we update the session to add info about `geoCoordinates`, `country`, and `postalCode`. But we were only doing that when the Delivery Promise feature was enabled. This conditional was removed. For the `sellers` info that we get from Checkout request, we only need to make this request if there is a `seller` info inside the `channel`. So a conditional was introduced to reduce the need of making this request every time. ## How to test it? Check it with Delivery Promise enabled and disabled. On both flows the session in the IndexedDB should be updated to add `regionId` inside the channel when a `postalCode` is added in the RegionBar. To check the `seller` info: an option is changing the config inside `discovery.config`: `channel: '{"salesChannel":"1","regionId":"","hasOnlyDefaultSalesChannel":"true", "seller":"storeframework01"}',` and also set a `postalCode` there: `postalCode: '90210',` The session in the IndexedDB should contain the valid seller (example: `storeframework01`) inside the channel if it was added (in config, for example). ### Starters Deploy Preview <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> ## References <!--- Spread the knowledge: is there any content you used to create this PR that is worth sharing? ---> <!--- Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process --->
## What's the purpose of this pull request? Update the Session with postal code, country, and geo-coordinates. The Intelligent Search will use this for the Delivery Promise feature. FastStore updates the session with the location information and IS access it. ## How it works? The update is a PATCH request to the Session Manager API. The fields that IS will use from the session are `postalCode`, `geoCoordinates` and `country`, inside the `public` namespace. ## How to test it? Run this code (or use the preview link below) and test changing the postal code and/or using a default one. The fields inside public namespace of the session should be updated accordingly. To check it you can run this request: ```curl curl --location 'https://storeframework.vtexcommercestable.com.br/api/sessions?items=public.postalCode,public.geoCoordinates,public.country' \ --header 'Cookie: vtex_session=ADD_HERE' ```⚠️ Substitute the "ADD_HERE" with the vtex_session cookie that you can get in the browser #### Preview with Delivery Promise NOT enabled https://storeframework-cm652ufll028lmgv665a6xv0g-lqicw1ez2.b.vtex.app/ The session shouldn't update the public field.   #### Preview with Delivery Promise enabled https://storeframework-cm652ufll028lmgv665a6xv0g-58v0e6a7h.b.vtex.app/ ##### Without postal code set The session shouldn't update the public field.   ##### With postal code (and country and geo coordinates) The session should update the public field!   ### Starters Deploy Preview https://github.com/vtex-sites/starter.store/pull/737 ## References - [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2362) - [Slack thread](https://vtex.slack.com/archives/C069YM7R73P/p1741962308203469?thread_ts=1741782251.679469&cid=C069YM7R73P) - [Session Manager API - Edit session](https://developers.vtex.com/docs/api-reference/session-manager-api#patch-/api/sessions)
## What's the purpose of this pull request? The PR #2749 introduced a bug: when the store doesn't have the Delivery Promise feature enabled, the channel `regionId` wasn't being updated. ## How it works? The Checkout updates the session's `regionId` when we update the session to add info about `geoCoordinates`, `country`, and `postalCode`. But we were only doing that when the Delivery Promise feature was enabled. This conditional was removed. For the `sellers` info that we get from Checkout request, we only need to make this request if there is a `seller` info inside the `channel`. So a conditional was introduced to reduce the need of making this request every time. ## How to test it? Check it with Delivery Promise enabled and disabled. On both flows the session in the IndexedDB should be updated to add `regionId` inside the channel when a `postalCode` is added in the RegionBar. To check the `seller` info: an option is changing the config inside `discovery.config`: `channel: '{"salesChannel":"1","regionId":"","hasOnlyDefaultSalesChannel":"true", "seller":"storeframework01"}',` and also set a `postalCode` there: `postalCode: '90210',` The session in the IndexedDB should contain the valid seller (example: `storeframework01`) inside the channel if it was added (in config, for example). ### Starters Deploy Preview <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> ## References <!--- Spread the knowledge: is there any content you used to create this PR that is worth sharing? ---> <!--- Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process --->
## What's the purpose of this pull request? Update the Session with postal code, country, and geo-coordinates. The Intelligent Search will use this for the Delivery Promise feature. FastStore updates the session with the location information and IS access it. ## How it works? The update is a PATCH request to the Session Manager API. The fields that IS will use from the session are `postalCode`, `geoCoordinates` and `country`, inside the `public` namespace. ## How to test it? Run this code (or use the preview link below) and test changing the postal code and/or using a default one. The fields inside public namespace of the session should be updated accordingly. To check it you can run this request: ```curl curl --location 'https://storeframework.vtexcommercestable.com.br/api/sessions?items=public.postalCode,public.geoCoordinates,public.country' \ --header 'Cookie: vtex_session=ADD_HERE' ```⚠️ Substitute the "ADD_HERE" with the vtex_session cookie that you can get in the browser #### Preview with Delivery Promise NOT enabled https://storeframework-cm652ufll028lmgv665a6xv0g-lqicw1ez2.b.vtex.app/ The session shouldn't update the public field.   #### Preview with Delivery Promise enabled https://storeframework-cm652ufll028lmgv665a6xv0g-58v0e6a7h.b.vtex.app/ ##### Without postal code set The session shouldn't update the public field.   ##### With postal code (and country and geo coordinates) The session should update the public field!   ### Starters Deploy Preview https://github.com/vtex-sites/starter.store/pull/737 ## References - [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2362) - [Slack thread](https://vtex.slack.com/archives/C069YM7R73P/p1741962308203469?thread_ts=1741782251.679469&cid=C069YM7R73P) - [Session Manager API - Edit session](https://developers.vtex.com/docs/api-reference/session-manager-api#patch-/api/sessions)
## What's the purpose of this pull request? The PR #2749 introduced a bug: when the store doesn't have the Delivery Promise feature enabled, the channel `regionId` wasn't being updated. ## How it works? The Checkout updates the session's `regionId` when we update the session to add info about `geoCoordinates`, `country`, and `postalCode`. But we were only doing that when the Delivery Promise feature was enabled. This conditional was removed. For the `sellers` info that we get from Checkout request, we only need to make this request if there is a `seller` info inside the `channel`. So a conditional was introduced to reduce the need of making this request every time. ## How to test it? Check it with Delivery Promise enabled and disabled. On both flows the session in the IndexedDB should be updated to add `regionId` inside the channel when a `postalCode` is added in the RegionBar. To check the `seller` info: an option is changing the config inside `discovery.config`: `channel: '{"salesChannel":"1","regionId":"","hasOnlyDefaultSalesChannel":"true", "seller":"storeframework01"}',` and also set a `postalCode` there: `postalCode: '90210',` The session in the IndexedDB should contain the valid seller (example: `storeframework01`) inside the channel if it was added (in config, for example). ### Starters Deploy Preview <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> ## References <!--- Spread the knowledge: is there any content you used to create this PR that is worth sharing? ---> <!--- Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process --->
## What's the purpose of this pull request? Feature branch for the Delivery Promise feature - phase 1 (navigation based on shopper location). - #2708 - #2728 - #2739 - #2745 - #2749 - #2750 - #2768 - #2772 - #2775 - #2809 - #2817 - #2824 - #2835 ## How it works? ## How to test it? ### Starters Deploy Preview ## References - [Jira epic](https://vtex-dev.atlassian.net/browse/SFS-1696) ## Checklist - [ ] For documentation changes, ping `@Mariana-Caetano` to review and update (Or submit a doc request) - [ ] TODO: Request Doc for PopOver - [ ] TODO: Remind to run cms sync in the default account when the feature branch is merged since new section was added. (And add the new section in the admin!) --------- Co-authored-by: Lucas Feijó <[email protected]> Co-authored-by: Fanny Chien <[email protected]>
Update the Session with postal code, country, and geo-coordinates. The Intelligent Search will use this for the Delivery Promise feature. FastStore updates the session with the location information and IS access it. The update is a PATCH request to the Session Manager API. The fields that IS will use from the session are `postalCode`, `geoCoordinates` and `country`, inside the `public` namespace. Run this code (or use the preview link below) and test changing the postal code and/or using a default one. The fields inside public namespace of the session should be updated accordingly. To check it you can run this request: ```curl curl --location 'https://storeframework.vtexcommercestable.com.br/api/sessions?items=public.postalCode,public.geoCoordinates,public.country' \ --header 'Cookie: vtex_session=ADD_HERE' ```⚠️ Substitute the "ADD_HERE" with the vtex_session cookie that you can get in the browser https://storeframework-cm652ufll028lmgv665a6xv0g-lqicw1ez2.b.vtex.app/ The session shouldn't update the public field.   https://storeframework-cm652ufll028lmgv665a6xv0g-58v0e6a7h.b.vtex.app/ The session shouldn't update the public field.   The session should update the public field!   https://github.com/vtex-sites/starter.store/pull/737 - [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2362) - [Slack thread](https://vtex.slack.com/archives/C069YM7R73P/p1741962308203469?thread_ts=1741782251.679469&cid=C069YM7R73P) - [Session Manager API - Edit session](https://developers.vtex.com/docs/api-reference/session-manager-api#patch-/api/sessions)
The PR #2749 introduced a bug: when the store doesn't have the Delivery Promise feature enabled, the channel `regionId` wasn't being updated. The Checkout updates the session's `regionId` when we update the session to add info about `geoCoordinates`, `country`, and `postalCode`. But we were only doing that when the Delivery Promise feature was enabled. This conditional was removed. For the `sellers` info that we get from Checkout request, we only need to make this request if there is a `seller` info inside the `channel`. So a conditional was introduced to reduce the need of making this request every time. Check it with Delivery Promise enabled and disabled. On both flows the session in the IndexedDB should be updated to add `regionId` inside the channel when a `postalCode` is added in the RegionBar. To check the `seller` info: an option is changing the config inside `discovery.config`: `channel: '{"salesChannel":"1","regionId":"","hasOnlyDefaultSalesChannel":"true", "seller":"storeframework01"}',` and also set a `postalCode` there: `postalCode: '90210',` The session in the IndexedDB should contain the valid seller (example: `storeframework01`) inside the channel if it was added (in config, for example). <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> <!--- Spread the knowledge: is there any content you used to create this PR that is worth sharing? ---> <!--- Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process --->
Update the Session with postal code, country, and geo-coordinates. The Intelligent Search will use this for the Delivery Promise feature. FastStore updates the session with the location information and IS access it. The update is a PATCH request to the Session Manager API. The fields that IS will use from the session are `postalCode`, `geoCoordinates` and `country`, inside the `public` namespace. Run this code (or use the preview link below) and test changing the postal code and/or using a default one. The fields inside public namespace of the session should be updated accordingly. To check it you can run this request: ```curl curl --location 'https://storeframework.vtexcommercestable.com.br/api/sessions?items=public.postalCode,public.geoCoordinates,public.country' \ --header 'Cookie: vtex_session=ADD_HERE' ```⚠️ Substitute the "ADD_HERE" with the vtex_session cookie that you can get in the browser https://storeframework-cm652ufll028lmgv665a6xv0g-lqicw1ez2.b.vtex.app/ The session shouldn't update the public field.   https://storeframework-cm652ufll028lmgv665a6xv0g-58v0e6a7h.b.vtex.app/ The session shouldn't update the public field.   The session should update the public field!   https://github.com/vtex-sites/starter.store/pull/737 - [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2362) - [Slack thread](https://vtex.slack.com/archives/C069YM7R73P/p1741962308203469?thread_ts=1741782251.679469&cid=C069YM7R73P) - [Session Manager API - Edit session](https://developers.vtex.com/docs/api-reference/session-manager-api#patch-/api/sessions)
The PR #2749 introduced a bug: when the store doesn't have the Delivery Promise feature enabled, the channel `regionId` wasn't being updated. The Checkout updates the session's `regionId` when we update the session to add info about `geoCoordinates`, `country`, and `postalCode`. But we were only doing that when the Delivery Promise feature was enabled. This conditional was removed. For the `sellers` info that we get from Checkout request, we only need to make this request if there is a `seller` info inside the `channel`. So a conditional was introduced to reduce the need of making this request every time. Check it with Delivery Promise enabled and disabled. On both flows the session in the IndexedDB should be updated to add `regionId` inside the channel when a `postalCode` is added in the RegionBar. To check the `seller` info: an option is changing the config inside `discovery.config`: `channel: '{"salesChannel":"1","regionId":"","hasOnlyDefaultSalesChannel":"true", "seller":"storeframework01"}',` and also set a `postalCode` there: `postalCode: '90210',` The session in the IndexedDB should contain the valid seller (example: `storeframework01`) inside the channel if it was added (in config, for example). <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> <!--- Spread the knowledge: is there any content you used to create this PR that is worth sharing? ---> <!--- Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process --->
Update the Session with postal code, country, and geo-coordinates. The Intelligent Search will use this for the Delivery Promise feature. FastStore updates the session with the location information and IS access it. The update is a PATCH request to the Session Manager API. The fields that IS will use from the session are `postalCode`, `geoCoordinates` and `country`, inside the `public` namespace. Run this code (or use the preview link below) and test changing the postal code and/or using a default one. The fields inside public namespace of the session should be updated accordingly. To check it you can run this request: ```curl curl --location 'https://storeframework.vtexcommercestable.com.br/api/sessions?items=public.postalCode,public.geoCoordinates,public.country' \ --header 'Cookie: vtex_session=ADD_HERE' ```⚠️ Substitute the "ADD_HERE" with the vtex_session cookie that you can get in the browser https://storeframework-cm652ufll028lmgv665a6xv0g-lqicw1ez2.b.vtex.app/ The session shouldn't update the public field.   https://storeframework-cm652ufll028lmgv665a6xv0g-58v0e6a7h.b.vtex.app/ The session shouldn't update the public field.   The session should update the public field!   https://github.com/vtex-sites/starter.store/pull/737 - [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2362) - [Slack thread](https://vtex.slack.com/archives/C069YM7R73P/p1741962308203469?thread_ts=1741782251.679469&cid=C069YM7R73P) - [Session Manager API - Edit session](https://developers.vtex.com/docs/api-reference/session-manager-api#patch-/api/sessions)
The PR #2749 introduced a bug: when the store doesn't have the Delivery Promise feature enabled, the channel `regionId` wasn't being updated. The Checkout updates the session's `regionId` when we update the session to add info about `geoCoordinates`, `country`, and `postalCode`. But we were only doing that when the Delivery Promise feature was enabled. This conditional was removed. For the `sellers` info that we get from Checkout request, we only need to make this request if there is a `seller` info inside the `channel`. So a conditional was introduced to reduce the need of making this request every time. Check it with Delivery Promise enabled and disabled. On both flows the session in the IndexedDB should be updated to add `regionId` inside the channel when a `postalCode` is added in the RegionBar. To check the `seller` info: an option is changing the config inside `discovery.config`: `channel: '{"salesChannel":"1","regionId":"","hasOnlyDefaultSalesChannel":"true", "seller":"storeframework01"}',` and also set a `postalCode` there: `postalCode: '90210',` The session in the IndexedDB should contain the valid seller (example: `storeframework01`) inside the channel if it was added (in config, for example). <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> <!--- Spread the knowledge: is there any content you used to create this PR that is worth sharing? ---> <!--- Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process --->
Update the Session with postal code, country, and geo-coordinates. The Intelligent Search will use this for the Delivery Promise feature. FastStore updates the session with the location information and IS access it. The update is a PATCH request to the Session Manager API. The fields that IS will use from the session are `postalCode`, `geoCoordinates` and `country`, inside the `public` namespace. Run this code (or use the preview link below) and test changing the postal code and/or using a default one. The fields inside public namespace of the session should be updated accordingly. To check it you can run this request: ```curl curl --location 'https://storeframework.vtexcommercestable.com.br/api/sessions?items=public.postalCode,public.geoCoordinates,public.country' \ --header 'Cookie: vtex_session=ADD_HERE' ```⚠️ Substitute the "ADD_HERE" with the vtex_session cookie that you can get in the browser https://storeframework-cm652ufll028lmgv665a6xv0g-lqicw1ez2.b.vtex.app/ The session shouldn't update the public field.   https://storeframework-cm652ufll028lmgv665a6xv0g-58v0e6a7h.b.vtex.app/ The session shouldn't update the public field.   The session should update the public field!   https://github.com/vtex-sites/starter.store/pull/737 - [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2362) - [Slack thread](https://vtex.slack.com/archives/C069YM7R73P/p1741962308203469?thread_ts=1741782251.679469&cid=C069YM7R73P) - [Session Manager API - Edit session](https://developers.vtex.com/docs/api-reference/session-manager-api#patch-/api/sessions)
The PR #2749 introduced a bug: when the store doesn't have the Delivery Promise feature enabled, the channel `regionId` wasn't being updated. The Checkout updates the session's `regionId` when we update the session to add info about `geoCoordinates`, `country`, and `postalCode`. But we were only doing that when the Delivery Promise feature was enabled. This conditional was removed. For the `sellers` info that we get from Checkout request, we only need to make this request if there is a `seller` info inside the `channel`. So a conditional was introduced to reduce the need of making this request every time. Check it with Delivery Promise enabled and disabled. On both flows the session in the IndexedDB should be updated to add `regionId` inside the channel when a `postalCode` is added in the RegionBar. To check the `seller` info: an option is changing the config inside `discovery.config`: `channel: '{"salesChannel":"1","regionId":"","hasOnlyDefaultSalesChannel":"true", "seller":"storeframework01"}',` and also set a `postalCode` there: `postalCode: '90210',` The session in the IndexedDB should contain the valid seller (example: `storeframework01`) inside the channel if it was added (in config, for example). <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> <!--- Spread the knowledge: is there any content you used to create this PR that is worth sharing? ---> <!--- Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process --->
Update the Session with postal code, country, and geo-coordinates. The Intelligent Search will use this for the Delivery Promise feature. FastStore updates the session with the location information and IS access it. The update is a PATCH request to the Session Manager API. The fields that IS will use from the session are `postalCode`, `geoCoordinates` and `country`, inside the `public` namespace. Run this code (or use the preview link below) and test changing the postal code and/or using a default one. The fields inside public namespace of the session should be updated accordingly. To check it you can run this request: ```curl curl --location 'https://storeframework.vtexcommercestable.com.br/api/sessions?items=public.postalCode,public.geoCoordinates,public.country' \ --header 'Cookie: vtex_session=ADD_HERE' ```⚠️ Substitute the "ADD_HERE" with the vtex_session cookie that you can get in the browser https://storeframework-cm652ufll028lmgv665a6xv0g-lqicw1ez2.b.vtex.app/ The session shouldn't update the public field.   https://storeframework-cm652ufll028lmgv665a6xv0g-58v0e6a7h.b.vtex.app/ The session shouldn't update the public field.   The session should update the public field!   https://github.com/vtex-sites/starter.store/pull/737 - [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2362) - [Slack thread](https://vtex.slack.com/archives/C069YM7R73P/p1741962308203469?thread_ts=1741782251.679469&cid=C069YM7R73P) - [Session Manager API - Edit session](https://developers.vtex.com/docs/api-reference/session-manager-api#patch-/api/sessions)
The PR #2749 introduced a bug: when the store doesn't have the Delivery Promise feature enabled, the channel `regionId` wasn't being updated. The Checkout updates the session's `regionId` when we update the session to add info about `geoCoordinates`, `country`, and `postalCode`. But we were only doing that when the Delivery Promise feature was enabled. This conditional was removed. For the `sellers` info that we get from Checkout request, we only need to make this request if there is a `seller` info inside the `channel`. So a conditional was introduced to reduce the need of making this request every time. Check it with Delivery Promise enabled and disabled. On both flows the session in the IndexedDB should be updated to add `regionId` inside the channel when a `postalCode` is added in the RegionBar. To check the `seller` info: an option is changing the config inside `discovery.config`: `channel: '{"salesChannel":"1","regionId":"","hasOnlyDefaultSalesChannel":"true", "seller":"storeframework01"}',` and also set a `postalCode` there: `postalCode: '90210',` The session in the IndexedDB should contain the valid seller (example: `storeframework01`) inside the channel if it was added (in config, for example). <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> <!--- Spread the knowledge: is there any content you used to create this PR that is worth sharing? ---> <!--- Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process --->
Update the Session with postal code, country, and geo-coordinates. The Intelligent Search will use this for the Delivery Promise feature. FastStore updates the session with the location information and IS access it. The update is a PATCH request to the Session Manager API. The fields that IS will use from the session are `postalCode`, `geoCoordinates` and `country`, inside the `public` namespace. Run this code (or use the preview link below) and test changing the postal code and/or using a default one. The fields inside public namespace of the session should be updated accordingly. To check it you can run this request: ```curl curl --location 'https://storeframework.vtexcommercestable.com.br/api/sessions?items=public.postalCode,public.geoCoordinates,public.country' \ --header 'Cookie: vtex_session=ADD_HERE' ```⚠️ Substitute the "ADD_HERE" with the vtex_session cookie that you can get in the browser https://storeframework-cm652ufll028lmgv665a6xv0g-lqicw1ez2.b.vtex.app/ The session shouldn't update the public field.   https://storeframework-cm652ufll028lmgv665a6xv0g-58v0e6a7h.b.vtex.app/ The session shouldn't update the public field.   The session should update the public field!   https://github.com/vtex-sites/starter.store/pull/737 - [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2362) - [Slack thread](https://vtex.slack.com/archives/C069YM7R73P/p1741962308203469?thread_ts=1741782251.679469&cid=C069YM7R73P) - [Session Manager API - Edit session](https://developers.vtex.com/docs/api-reference/session-manager-api#patch-/api/sessions)
The PR #2749 introduced a bug: when the store doesn't have the Delivery Promise feature enabled, the channel `regionId` wasn't being updated. The Checkout updates the session's `regionId` when we update the session to add info about `geoCoordinates`, `country`, and `postalCode`. But we were only doing that when the Delivery Promise feature was enabled. This conditional was removed. For the `sellers` info that we get from Checkout request, we only need to make this request if there is a `seller` info inside the `channel`. So a conditional was introduced to reduce the need of making this request every time. Check it with Delivery Promise enabled and disabled. On both flows the session in the IndexedDB should be updated to add `regionId` inside the channel when a `postalCode` is added in the RegionBar. To check the `seller` info: an option is changing the config inside `discovery.config`: `channel: '{"salesChannel":"1","regionId":"","hasOnlyDefaultSalesChannel":"true", "seller":"storeframework01"}',` and also set a `postalCode` there: `postalCode: '90210',` The session in the IndexedDB should contain the valid seller (example: `storeframework01`) inside the channel if it was added (in config, for example). <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> <!--- Spread the knowledge: is there any content you used to create this PR that is worth sharing? ---> <!--- Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process --->
Update the Session with postal code, country, and geo-coordinates. The Intelligent Search will use this for the Delivery Promise feature. FastStore updates the session with the location information and IS access it. The update is a PATCH request to the Session Manager API. The fields that IS will use from the session are `postalCode`, `geoCoordinates` and `country`, inside the `public` namespace. Run this code (or use the preview link below) and test changing the postal code and/or using a default one. The fields inside public namespace of the session should be updated accordingly. To check it you can run this request: ```curl curl --location 'https://storeframework.vtexcommercestable.com.br/api/sessions?items=public.postalCode,public.geoCoordinates,public.country' \ --header 'Cookie: vtex_session=ADD_HERE' ```⚠️ Substitute the "ADD_HERE" with the vtex_session cookie that you can get in the browser https://storeframework-cm652ufll028lmgv665a6xv0g-lqicw1ez2.b.vtex.app/ The session shouldn't update the public field.   https://storeframework-cm652ufll028lmgv665a6xv0g-58v0e6a7h.b.vtex.app/ The session shouldn't update the public field.   The session should update the public field!   https://github.com/vtex-sites/starter.store/pull/737 - [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2362) - [Slack thread](https://vtex.slack.com/archives/C069YM7R73P/p1741962308203469?thread_ts=1741782251.679469&cid=C069YM7R73P) - [Session Manager API - Edit session](https://developers.vtex.com/docs/api-reference/session-manager-api#patch-/api/sessions)
The PR #2749 introduced a bug: when the store doesn't have the Delivery Promise feature enabled, the channel `regionId` wasn't being updated. The Checkout updates the session's `regionId` when we update the session to add info about `geoCoordinates`, `country`, and `postalCode`. But we were only doing that when the Delivery Promise feature was enabled. This conditional was removed. For the `sellers` info that we get from Checkout request, we only need to make this request if there is a `seller` info inside the `channel`. So a conditional was introduced to reduce the need of making this request every time. Check it with Delivery Promise enabled and disabled. On both flows the session in the IndexedDB should be updated to add `regionId` inside the channel when a `postalCode` is added in the RegionBar. To check the `seller` info: an option is changing the config inside `discovery.config`: `channel: '{"salesChannel":"1","regionId":"","hasOnlyDefaultSalesChannel":"true", "seller":"storeframework01"}',` and also set a `postalCode` there: `postalCode: '90210',` The session in the IndexedDB should contain the valid seller (example: `storeframework01`) inside the channel if it was added (in config, for example). <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> <!--- Spread the knowledge: is there any content you used to create this PR that is worth sharing? ---> <!--- Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process --->
Update the Session with postal code, country, and geo-coordinates. The Intelligent Search will use this for the Delivery Promise feature. FastStore updates the session with the location information and IS access it. The update is a PATCH request to the Session Manager API. The fields that IS will use from the session are `postalCode`, `geoCoordinates` and `country`, inside the `public` namespace. Run this code (or use the preview link below) and test changing the postal code and/or using a default one. The fields inside public namespace of the session should be updated accordingly. To check it you can run this request: ```curl curl --location 'https://storeframework.vtexcommercestable.com.br/api/sessions?items=public.postalCode,public.geoCoordinates,public.country' \ --header 'Cookie: vtex_session=ADD_HERE' ```⚠️ Substitute the "ADD_HERE" with the vtex_session cookie that you can get in the browser https://storeframework-cm652ufll028lmgv665a6xv0g-lqicw1ez2.b.vtex.app/ The session shouldn't update the public field.   https://storeframework-cm652ufll028lmgv665a6xv0g-58v0e6a7h.b.vtex.app/ The session shouldn't update the public field.   The session should update the public field!   https://github.com/vtex-sites/starter.store/pull/737 - [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2362) - [Slack thread](https://vtex.slack.com/archives/C069YM7R73P/p1741962308203469?thread_ts=1741782251.679469&cid=C069YM7R73P) - [Session Manager API - Edit session](https://developers.vtex.com/docs/api-reference/session-manager-api#patch-/api/sessions)
The PR #2749 introduced a bug: when the store doesn't have the Delivery Promise feature enabled, the channel `regionId` wasn't being updated. The Checkout updates the session's `regionId` when we update the session to add info about `geoCoordinates`, `country`, and `postalCode`. But we were only doing that when the Delivery Promise feature was enabled. This conditional was removed. For the `sellers` info that we get from Checkout request, we only need to make this request if there is a `seller` info inside the `channel`. So a conditional was introduced to reduce the need of making this request every time. Check it with Delivery Promise enabled and disabled. On both flows the session in the IndexedDB should be updated to add `regionId` inside the channel when a `postalCode` is added in the RegionBar. To check the `seller` info: an option is changing the config inside `discovery.config`: `channel: '{"salesChannel":"1","regionId":"","hasOnlyDefaultSalesChannel":"true", "seller":"storeframework01"}',` and also set a `postalCode` there: `postalCode: '90210',` The session in the IndexedDB should contain the valid seller (example: `storeframework01`) inside the channel if it was added (in config, for example). <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> <!--- Spread the knowledge: is there any content you used to create this PR that is worth sharing? ---> <!--- Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process --->
Update the Session with postal code, country, and geo-coordinates. The Intelligent Search will use this for the Delivery Promise feature. FastStore updates the session with the location information and IS access it. The update is a PATCH request to the Session Manager API. The fields that IS will use from the session are `postalCode`, `geoCoordinates` and `country`, inside the `public` namespace. Run this code (or use the preview link below) and test changing the postal code and/or using a default one. The fields inside public namespace of the session should be updated accordingly. To check it you can run this request: ```curl curl --location 'https://storeframework.vtexcommercestable.com.br/api/sessions?items=public.postalCode,public.geoCoordinates,public.country' \ --header 'Cookie: vtex_session=ADD_HERE' ```⚠️ Substitute the "ADD_HERE" with the vtex_session cookie that you can get in the browser https://storeframework-cm652ufll028lmgv665a6xv0g-lqicw1ez2.b.vtex.app/ The session shouldn't update the public field.   https://storeframework-cm652ufll028lmgv665a6xv0g-58v0e6a7h.b.vtex.app/ The session shouldn't update the public field.   The session should update the public field!   https://github.com/vtex-sites/starter.store/pull/737 - [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2362) - [Slack thread](https://vtex.slack.com/archives/C069YM7R73P/p1741962308203469?thread_ts=1741782251.679469&cid=C069YM7R73P) - [Session Manager API - Edit session](https://developers.vtex.com/docs/api-reference/session-manager-api#patch-/api/sessions)
The PR #2749 introduced a bug: when the store doesn't have the Delivery Promise feature enabled, the channel `regionId` wasn't being updated. The Checkout updates the session's `regionId` when we update the session to add info about `geoCoordinates`, `country`, and `postalCode`. But we were only doing that when the Delivery Promise feature was enabled. This conditional was removed. For the `sellers` info that we get from Checkout request, we only need to make this request if there is a `seller` info inside the `channel`. So a conditional was introduced to reduce the need of making this request every time. Check it with Delivery Promise enabled and disabled. On both flows the session in the IndexedDB should be updated to add `regionId` inside the channel when a `postalCode` is added in the RegionBar. To check the `seller` info: an option is changing the config inside `discovery.config`: `channel: '{"salesChannel":"1","regionId":"","hasOnlyDefaultSalesChannel":"true", "seller":"storeframework01"}',` and also set a `postalCode` there: `postalCode: '90210',` The session in the IndexedDB should contain the valid seller (example: `storeframework01`) inside the channel if it was added (in config, for example). <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> <!--- Spread the knowledge: is there any content you used to create this PR that is worth sharing? ---> <!--- Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process --->
Update the Session with postal code, country, and geo-coordinates. The Intelligent Search will use this for the Delivery Promise feature. FastStore updates the session with the location information and IS access it. The update is a PATCH request to the Session Manager API. The fields that IS will use from the session are `postalCode`, `geoCoordinates` and `country`, inside the `public` namespace. Run this code (or use the preview link below) and test changing the postal code and/or using a default one. The fields inside public namespace of the session should be updated accordingly. To check it you can run this request: ```curl curl --location 'https://storeframework.vtexcommercestable.com.br/api/sessions?items=public.postalCode,public.geoCoordinates,public.country' \ --header 'Cookie: vtex_session=ADD_HERE' ```⚠️ Substitute the "ADD_HERE" with the vtex_session cookie that you can get in the browser https://storeframework-cm652ufll028lmgv665a6xv0g-lqicw1ez2.b.vtex.app/ The session shouldn't update the public field.   https://storeframework-cm652ufll028lmgv665a6xv0g-58v0e6a7h.b.vtex.app/ The session shouldn't update the public field.   The session should update the public field!   https://github.com/vtex-sites/starter.store/pull/737 - [Jira task](https://vtex-dev.atlassian.net/browse/SFS-2362) - [Slack thread](https://vtex.slack.com/archives/C069YM7R73P/p1741962308203469?thread_ts=1741782251.679469&cid=C069YM7R73P) - [Session Manager API - Edit session](https://developers.vtex.com/docs/api-reference/session-manager-api#patch-/api/sessions)
The PR #2749 introduced a bug: when the store doesn't have the Delivery Promise feature enabled, the channel `regionId` wasn't being updated. The Checkout updates the session's `regionId` when we update the session to add info about `geoCoordinates`, `country`, and `postalCode`. But we were only doing that when the Delivery Promise feature was enabled. This conditional was removed. For the `sellers` info that we get from Checkout request, we only need to make this request if there is a `seller` info inside the `channel`. So a conditional was introduced to reduce the need of making this request every time. Check it with Delivery Promise enabled and disabled. On both flows the session in the IndexedDB should be updated to add `regionId` inside the channel when a `postalCode` is added in the RegionBar. To check the `seller` info: an option is changing the config inside `discovery.config`: `channel: '{"salesChannel":"1","regionId":"","hasOnlyDefaultSalesChannel":"true", "seller":"storeframework01"}',` and also set a `postalCode` there: `postalCode: '90210',` The session in the IndexedDB should contain the valid seller (example: `storeframework01`) inside the channel if it was added (in config, for example). <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> <!--- Spread the knowledge: is there any content you used to create this PR that is worth sharing? ---> <!--- Extra tip: adding references to related issues or mentioning people important to this PR may be good for the documentation and reviewing process --->


What's the purpose of this pull request?
Update the Session with postal code, country, and geo-coordinates.
The Intelligent Search will use this for the Delivery Promise feature. FastStore updates the session with the location information and IS access it.
How it works?
The update is a PATCH request to the Session Manager API. The fields that IS will use from the session are
postalCode,geoCoordinatesandcountry, inside thepublicnamespace.How to test it?
Run this code (or use the preview link below) and test changing the postal code and/or using a default one.
The fields inside public namespace of the session should be updated accordingly.
To check it you can run this request:
Preview with Delivery Promise NOT enabled
https://storeframework-cm652ufll028lmgv665a6xv0g-lqicw1ez2.b.vtex.app/
The session shouldn't update the public field.
Preview with Delivery Promise enabled
https://storeframework-cm652ufll028lmgv665a6xv0g-58v0e6a7h.b.vtex.app/
Without postal code set
The session shouldn't update the public field.
With postal code (and country and geo coordinates)
The session should update the public field!
Starters Deploy Preview
https://github.com/vtex-sites/starter.store/pull/737
References