You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Opening the Account page, a request with the useCurrentCustomer hook is made.
The response contains an addresses key with the user addresses.
If you edit the profile (for example changing the first name), and press save, the mutation called with useShopperCustomersMutation('updateCustomer') overwrites the response of the useCurrentCustomer deleting the addresses key.
Doing so, if you go to the Addesses section of the user account page you don't see any addresses. Still, they reappear if you force a page reload performing a fresh useCurrentCustomer call.
Register a new account (or login if you already have one)
In the account page, head to the Addresses section and add an address if you don't already have one
In the account page, back to the Account Details* section, click the "Edit" in the My Profile card, change something like the first name and press Save
Now click the Addesses section in the sidebar
You will see the No Saved Addresses block.
Reloading the page will perform a fresh request loading the addresses again.
Expected result
Editing the user profile shouldn't remove necessary account data from the response
Actual result
The cached useCurrentCustomer response (seen from the React Tanstack Query Debug tool) loses the addresses key after saving the user profile.
System Information (as applicable)
Browser: Google Chrome Node version: 18.15.0 pwa-kit version: Tested on 3.1.0 and 3.6.0 Desktop OS: macOS Mobile Device Info: -
The text was updated successfully, but these errors were encountered:
Thank you @sdenadai for reporting this. I can confirm that this is an issue after following your steps to reproduce. I'm going to tag this issue so it makes its way into our ticketing system.
In the meantime, a simple work around would be to re-fetch that customer information with the addresses using the "useCurrentCustomer" hook.
Summary
Opening the Account page, a request with the
useCurrentCustomer
hook is made.The response contains an
addresses
key with the user addresses.If you edit the profile (for example changing the first name), and press save, the mutation called with
useShopperCustomersMutation('updateCustomer')
overwrites the response of theuseCurrentCustomer
deleting theaddresses
key.Doing so, if you go to the Addesses section of the user account page you don't see any addresses. Still, they reappear if you force a page reload performing a fresh
useCurrentCustomer
call.Steps To Reproduce
This issue can easily be seen on the official pwa-kit demo (https://pwa-kit.mobify-storefront.com/).
Expected result
Editing the user profile shouldn't remove necessary account data from the response
Actual result
The cached useCurrentCustomer response (seen from the React Tanstack Query Debug tool) loses the addresses key after saving the user profile.
System Information (as applicable)
Browser: Google Chrome
Node version: 18.15.0
pwa-kit version: Tested on 3.1.0 and 3.6.0
Desktop OS: macOS
Mobile Device Info: -
The text was updated successfully, but these errors were encountered: