FIX: #73 prevent empty wishlists from being created on every page load#84
Open
crydotsnake wants to merge 1 commit into
Open
Conversation
dfd43b7 to
1e76b17
Compare
1e76b17 to
7fbd81d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Issue: #73
Previously, when a guest visited a product page, empty entries were automatically created in the
sylius_wishlisttable and awishlist_cookie_tokenwas set at the same time. This was becausethe form builders called
resolveAndCreate()when rendering the page. For every request, including those from bots. This led to the table becoming overloaded over time, thereby slowing it down.An entry in the
sylius_wishlisttable and awishlist_cookie_tokenshould only be created when a wishlist is created.I have changed the behaviour so that when a product page is loaded, no DB entry and no
cookie is set. Both actions only occur when a product is actually added to the wishlist.
The behaviour for users who are already logged in and have an existing wishlist remains unchanged.
I tested both behaviours at the end, both as a guest user and as a registered user. I haven’t noticed any further errors so far.