Skip to content

FIX: #73 prevent empty wishlists from being created on every page load#84

Open
crydotsnake wants to merge 1 commit into
Sylius:1.2from
crydotsnake:fix/73/generate-wishlist-token-only-when-wishlist-is-created
Open

FIX: #73 prevent empty wishlists from being created on every page load#84
crydotsnake wants to merge 1 commit into
Sylius:1.2from
crydotsnake:fix/73/generate-wishlist-token-only-when-wishlist-is-created

Conversation

@crydotsnake

@crydotsnake crydotsnake commented May 10, 2026

Copy link
Copy Markdown
Member

Description

Issue: #73

Previously, when a guest visited a product page, empty entries were automatically created in the
sylius_wishlist table and a wishlist_cookie_token was set at the same time. This was because
the 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_wishlist table and a wishlist_cookie_token should 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.

@crydotsnake crydotsnake requested a review from a team as a code owner May 10, 2026 10:18
@crydotsnake crydotsnake changed the title FIX: #73 generate wishlist token only when wishlist is created FIX: #73 prevent empty wishlists from being created on every page load May 10, 2026
@crydotsnake crydotsnake force-pushed the fix/73/generate-wishlist-token-only-when-wishlist-is-created branch from dfd43b7 to 1e76b17 Compare May 10, 2026 10:51
@crydotsnake crydotsnake force-pushed the fix/73/generate-wishlist-token-only-when-wishlist-is-created branch from 1e76b17 to 7fbd81d Compare May 10, 2026 11:00
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.

1 participant