Skip to content

chore: Ensure session with location data - #2745

Merged
lucasfp13 merged 8 commits into
feat/delivery-promisefrom
chore/ensure-session-with-location-data
Mar 26, 2025
Merged

lucasfp13 merged 8 commits into
feat/delivery-promisefrom
chore/ensure-session-with-location-data

Conversation

@lucasfp13

@lucasfp13 lucasfp13 commented Mar 25, 2025 •

Copy link
Copy Markdown
Contributor

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

@lucasfp13 lucasfp13 self-assigned this Mar 25, 2025
@lucasfp13
lucasfp13 requested a review from a team as a code owner March 25, 2025 12:37
@codesandbox-ci

codesandbox-ci Bot commented Mar 25, 2025 •

Copy link
Copy Markdown

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.

@matheusps matheusps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hellofanny

hellofanny commented Mar 25, 2025 •

Copy link
Copy Markdown
Contributor

Scenario that I was testing

  1. no postalCode, consent geo location -> geoCoordinates values updated as expected / no PostalCode ✅
  2. setPostalCode -> postalCode set and geoCoordinates updated according to postalCode as expected ✅
  3. when refreshing the page (with postalCode set and geoCoordinates - scenario 2) the session get lost(?) and the postalCode is null again and is back to scenario 1. [Maybe we did something that is causing this problem]

@lucasfp13

Copy link
Copy Markdown
Contributor Author

Scenario that I was testing

  1. no postalCode, consent geo location -> geoCoordinates values updated as expected / no PostalCode ✅
  2. setPostalCode -> postalCode set and geoCoordinates updated according to postalCode as expected ✅
  3. when refreshing the page (with postalCode set and geoCoordinates - scenario 2) the session get lost(?) and the postalCode is null again and is back to scenario 1. [Maybe we did something that is causing this problem]

The third scenario was fixed in c9c8901

StoreSession,
} from '../../../__generated__/schema'

async function getGeoCoordinates(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@hellofanny hellofanny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


async function askGeolocationConsent() {
const { postalCode: stalePostalCode, geoCoordinates: staleGeoCoordinates } =
sessionStore.read()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: why change from useSession() to sessionStore.read()?

@lucasfp13 lucasfp13 Mar 26, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lucasfp13
lucasfp13 merged commit 5d756ba into feat/delivery-promise Mar 26, 2025
@lucasfp13
lucasfp13 deleted the chore/ensure-session-with-location-data branch March 26, 2025 15:17
hellofanny added a commit that referenced this pull request Mar 26, 2025
## 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]>
lariciamota added a commit that referenced this pull request Mar 27, 2025
## 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]>
lariciamota added a commit that referenced this pull request Mar 28, 2025
## 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]>
lariciamota added a commit that referenced this pull request Apr 8, 2025
## 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]>
lariciamota added a commit that referenced this pull request Apr 11, 2025
## 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]>
lariciamota added a commit that referenced this pull request Apr 22, 2025
## 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]>
lariciamota added a commit that referenced this pull request May 8, 2025
## 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]>
lariciamota added a commit that referenced this pull request May 12, 2025
## 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]>
lariciamota added a commit that referenced this pull request May 13, 2025
## 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]>
lariciamota added a commit that referenced this pull request May 13, 2025
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]>
lariciamota added a commit that referenced this pull request May 13, 2025
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]>
lariciamota added a commit that referenced this pull request May 14, 2025
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]>
lucasfp13 added a commit that referenced this pull request May 16, 2025
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]>
lariciamota added a commit that referenced this pull request Jun 20, 2025
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]>
lariciamota added a commit that referenced this pull request Jun 23, 2025
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]>
hellofanny added a commit that referenced this pull request Jun 27, 2025
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]>
lariciamota added a commit that referenced this pull request Jul 2, 2025
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]>
hellofanny added a commit that referenced this pull request Jul 2, 2025
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]>
lariciamota added a commit that referenced this pull request Jul 24, 2025
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]>
lariciamota added a commit that referenced this pull request Jul 30, 2025
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]>
lariciamota added a commit that referenced this pull request Jul 30, 2025
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]>
lariciamota added a commit that referenced this pull request Aug 1, 2025
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]>
hellofanny added a commit that referenced this pull request Aug 11, 2025
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]>
lariciamota added a commit that referenced this pull request Sep 2, 2025
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]>
lariciamota added a commit that referenced this pull request Sep 16, 2025
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]>
lariciamota added a commit that referenced this pull request Sep 16, 2025
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]>
lariciamota added a commit that referenced this pull request Sep 18, 2025
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]>
lariciamota added a commit that referenced this pull request Sep 23, 2025
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]>
lariciamota added a commit that referenced this pull request Sep 30, 2025
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]>
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.

4 participants