-
-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deleting a variant has no direct effect on a shopfront #3629
Comments
This looks like a cache problem. With the new feature to disable cache we can disable cache and see if this happens with the cache disabled :-) |
This could be a duplicate of #2111. In that case it's no cache problem. |
Changing the product a second time is a workaround, isn't it? Or first remove it from the order cycle and then delete it. |
I looked into this and we have all the code to update the cache when a variant is destroyed. But we never call The current implementation: openfoodnetwork/app/models/spree/variant_decorator.rb Lines 127 to 143 in 130ba64
Where we should apply it: openfoodnetwork/app/models/spree/variant_decorator.rb Lines 100 to 111 in 130ba64
This would be solved with Spree 2 because we get rid of our soft-delete implementation. Spree 2 always soft deletes when calling I'm calling it a day now. Feel free to work on this issue. Otherwise I may have time tomorrow to work on this. |
Yes you are right. I'm downgrading to s3. |
Thanks for the investigation @mkllnk. I think I can take it and fix it given my last week's cache deep-dive. |
These tests prove that openfoodfoundation#3629 is indeed is a bug because we don't refresh the cache when deleting a variant.
I'm not sure whom you asked to test it @sauloperez. Did you mean @RachL or me to test this? @RachL would you mind testing this when you are next testing v2 anyway? |
@mkllnk will do! |
@mkllnk @sauloperez good catch, the issue remains in v2. I will open an issue for it. |
@mkllnk @sauloperez ok nevermind when I retested again to write the issue i couldn't reproduced it. |
have you enabled cache in the backoffice? |
@luisramos0 it is enabled by default I guess? Because I just saw that the bow is ticked, so I guess it was ticked when I did my test? |
yeah, if it is enabled now, I think it's safe to assume it was enabled when you tested. |
Description
If you delete a variant, it keeps showing up on the shopfront until you save a second time changes on your product.
If someone attempts to add this deleted variant to cart it gets a infinite loader
I saw this while testing #3619 but could reproduced it on French production
Steps to Reproduce
I reproduce all this on French product but this time I also tried to add the deleted variant to card. I got an infinite loader on the add to cart button:
Reloading the page stop the loader, but my variant is still showing up. It's the v2 variant bottom page here: https://www.openfoodfrance.org/hub-demo-open-food-france/shop
Animated Gif/Screenshot
Severity
bug-s2: a non-critical feature is broken, no workaround
Your Environment
The text was updated successfully, but these errors were encountered: