Repository navigation
chore: Ensure session with location data - #2745
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. |
|
Scenario that I was testing
|
The third scenario was fixed in c9c8901 |
| StoreSession, | ||
| } from '../../../__generated__/schema' | ||
|
|
||
| async function getGeoCoordinates( |
hellofanny
left a comment
There was a problem hiding this comment.
LGTM 🚀 🚀
I've validated the following scenarios:
1- when postalCode/country provided updated with the geoCoordinates as expected ✅ (without navigator consent.)
zipcode-country-getcoord.mov
2- the previous scenario that was reseting the postalCode (geoCordinates consent -> postalCode provided -> refresh -> the postalCode and geoCoordinates are kept as expected) ✅
refresh-no-reset.mov
Co-authored-by: Fanny Chien <[email protected]>
|
|
||
| async function askGeolocationConsent() { | ||
| const { postalCode: stalePostalCode, geoCoordinates: staleGeoCoordinates } = | ||
| sessionStore.read() |
There was a problem hiding this comment.
question: why change from useSession() to sessionStore.read()?
There was a problem hiding this comment.
We can't have useSession values updated since the execution of useGeolocation's effect is one-time only, that's why I was using stale values just to the first check then reading session values again.
Co-authored-by: Larícia Mota <[email protected]>
## What's the purpose of this pull request? This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. ## How it works? It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. ## How to test it? - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. ### Starters Deploy Preview vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
## What's the purpose of this pull request? This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. ## How it works? It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. ## How to test it? - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. ### Starters Deploy Preview vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
## What's the purpose of this pull request? This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. ## How it works? It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. ## How to test it? - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. ### Starters Deploy Preview vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
## What's the purpose of this pull request? This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. ## How it works? It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. ## How to test it? - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. ### Starters Deploy Preview vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
## What's the purpose of this pull request? This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. ## How it works? It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. ## How to test it? - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. ### Starters Deploy Preview vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
## What's the purpose of this pull request? This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. ## How it works? It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. ## How to test it? - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. ### Starters Deploy Preview vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
## What's the purpose of this pull request? This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. ## How it works? It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. ## How to test it? - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. ### Starters Deploy Preview vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
## What's the purpose of this pull request? This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. ## How it works? It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. ## How to test it? - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. ### Starters Deploy Preview vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
## 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]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
This PR intends to ensure all location data (`postalCode`, `geoCoordinates` and `country`) is being synchronized when needed. It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late. - Enable Delivery Promise on discovery.config; - Open the localhost store on anon tab (to ensure no stale data); - First, consent geo location data from popup and look to the IDB `fs::session` value, it should fill `geoCoordinates` data after `useGeolocation` hook execution; - Then try to set a postal code, the `postalCode` should be set and `geoCoordinates` should be different now (based on the postal code); - Another test: open another anon tab and, while the popup asking for geo location consent set a postal code. Then, after the session is updated with the new location (based on the postal code), grant the geo location consent and nothing should happen since user have already set the postal code. vtex-sites/starter.store#734 --------- Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Larícia Mota <[email protected]>
What's the purpose of this pull request?
This PR intends to ensure all location data (
postalCode,geoCoordinatesandcountry) is being synchronized when needed.How it works?
It updates geo coordinates when users set a postal code and ensure location data won't be overwritten if users grant geo location consent late.
How to test it?
fs::sessionvalue, it should fillgeoCoordinatesdata afteruseGeolocationhook execution;postalCodeshould be set andgeoCoordinatesshould be different now (based on the postal code);Starters Deploy Preview
vtex-sites/starter.store#734