Open nhp opened 5 years ago
+1
I'm going to look into this. After a release, we often get enquiries from users who can't add items to the cart and experience other issues. Sometimes it's fixed by simply reloading the page. Other times we have to instruct them to clear their browser cache, which is not ideal.
As a first step, I'm thinking of showing an error alert with a button to reload the page. The message would be something like:
A new version of this website is available. Please click the button below to reload and update to the latest version.
@pkarw How do you think this should be handled?
This is a complicated issue. Even for just updating the service worker. See: https://redfin.engineering/how-to-fix-the-refresh-button-when-using-service-workers-a8e27af6df68
There's a possible solution for that, but it requires the completion of vuestorefront/vue-storefront#1589
Imho we can easily use Web Push or even API endpoint to inform users about new version and react accordingly. For sure it's a feature that we need in 1.11
Related to storageQuota
cleaning mechanism we already have in here: https://github.com/DivanteLtd/vue-storefront/blob/3d1d81c0e1aebfcdeda97ea7fec58b6d3ab8ef29/core/store/lib/storage.ts#L63
We probably need to add a feature - kind of kill switch which is clearing out the localStorage; not sure how it should work; maybe - setting a localStorage hash with the current build number or hash - then in VS startup (app.ts) let’s check if it changed - if so: let’s programmatically clear the storage
vuestorefront/vue-storefront#3650
What is the motivation for adding / enhancing this feature?
There should be a possibility for targeted local storage flushing. Like after a deployment or rebuild this could be needed to have the current information available at the client side. Right now it is up to the user to do so and that is not really helpful for getting updated stuff out to the browser. If the user completely throws their local storage we need to take care of not accidentally clearing the cart information.
What are the acceptance criteria
Can you complete this feature request by yourself?
Which Release Cycle state this refers to? Info for developer.
Pick one option.
develop
branch and create Pull Request2. Feature / Improvement
back todevelop
.release
branch and create Pull Request3. Stabilisation fix
back torelease
.hotfix
ormaster
branch and create Pull Request4. Hotfix
back tohotfix
.Additional information
According to w3c this is intended behavior as the user or the application is responsible for the local storage only. There is no TTL intended, but there are different options we found: https://stackoverflow.com/questions/2326943/when-do-items-in-html5-local-storage-expire but nothing seems "ready to use"