Skip to content
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

[4.x]: Upgrading causes all anonymous carts to be linked to one user #3302

Closed
nfourtythree opened this issue Oct 13, 2023 · 2 comments
Closed
Labels
bug commerce4 Issues related to Commerce v4 🔎 status: investigating Trying to reproduce

Comments

@nfourtythree
Copy link
Contributor

What happened?

Description

Reported in Discord

So, something interesting happened while testing out a Craft 3 -> 4 upgrade in local dev.

Roughly 3.700 inactive carts caused the same number of inactive users to be created, all with only an ID as name and nothing else. Strange but I haven't looked into if that's intended or not. Maybe there's a good reason.

However, the very last of those "ID users" to be created, was associated with ALL 3.700 inactive carts. So one weird user account owns all the inactive carts now and the rest are just empty.

Craft CMS version

4.x

Craft Commerce version

4.x

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@nfourtythree nfourtythree added bug 🔎 status: investigating Trying to reproduce commerce4 Issues related to Commerce v4 labels Oct 13, 2023
@Kent-N
Copy link

Kent-N commented Oct 16, 2023

I'm the one who reported the issue on Discord.

I did some further testing and saw that the UpgradeController had a lot of performance improvements added in 4.3.0.

Locking my Commerce version to 4.2.11 and running the upgrade, seems to produce the expected results. Doesn't fill the inactive users with a bunch of "ID only" accounts and there's also no single account associated with all anonymous carts.

To add more context to this issue: I encountered the problem while trying to upgrade from Commerce 3.4.22.1 -> 4.3.0.

@nfourtythree
Copy link
Contributor Author

Hi @Kent-N

Thank you for your response.

We have just pushed up a fix which we believe solves this issue. Along with another fix that was included in this issue.

These should help improve the upgrade performance and also prevent the issue you mentioned from happening. The fixes will be included in the next release of Commerce.

To get this early, you can change your craftcms/commerce requirement in your project's composer.json to:

"require": {
  "craftcms/commerce": "dev-develop#d4d4dc79d0fc8884b158a2a867a5e458e273aebc as 4.3.0",
  "...": "..."
}

Then run composer update.

Please let us know if you continue to have issues with this, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug commerce4 Issues related to Commerce v4 🔎 status: investigating Trying to reproduce
Projects
None yet
Development

No branches or pull requests

2 participants