duncanmcclean / simple-commerce

A simple, yet powerful e-commerce addon for Statamic.
https://statamic.com/addons/duncanmcclean/simple-commerce
Other
146 stars 40 forks source link

Recursion detected error on Cart update route #1024

Closed Web10-Joris closed 7 months ago

Web10-Joris commented 7 months ago

Description

I just upgraded Runway & SC to the recent versions and rebuilt my docker container + newly migrated database but getting an Recursion error on updating the cart via axios using the 'cart update' tag. On a complete empty database it shows this recursion error. It is maybe due to my one-page checkout template, but not sure.

Stack trace here: https://flareapp.io/share/17WabgWm

Steps to reproduce

  1. Create new environment with my repo
  2. Add product to cart and go to checkout
  3. Fill in dummy details on checkout page
  4. See the error coming form axios post after changing country field.

Environment

Environment Application Name: XXX Laravel Version: 10.45.1 PHP Version: 8.1.5 Composer Version: 2.5.5 Environment: local Debug Mode: ENABLED URL: localhost/ Maintenance Mode: OFF

Cache Config: NOT CACHED Events: NOT CACHED Routes: NOT CACHED Views: CACHED

Drivers Broadcasting: log Cache: statamic Database: mysql Logs: stack / daily, flare Mail: smtp Queue: sync Session: file

Simple Commerce Currencies: EUR, EUR, EUR, EUR Gateways: Mollie Repository: Customer: DuncanMcClean\SimpleCommerce\Customers\EloquentCustomerRepository Repository: Order: DuncanMcClean\SimpleCommerce\Orders\EloquentOrderRepository Repository: Product: DuncanMcClean\SimpleCommerce\Products\EntryProductRepository Shipping Methods: Pallet, International Tax Engine: App\SimpleCommerce\CompanyTaxEngine

Statamic Addons: 5 Antlers: runtime Sites: 4 (NL, DE, EN, PL) Stache Watcher: Enabled Static Caching: Disabled Version: 4.49.0 PRO

Statamic Addons aerni/advanced-seo: 2.4.3 duncanmcclean/simple-commerce: 6.0.8 heidkaemper/statamic-toolbar: 1.1.2 statamic-rad-pack/runway: 6.3.0 statamic/collaboration: 0.8.1

Web10-Joris commented 7 months ago

When reproducing is not possible: You should still have access to my repo, same content zip can be used

duncanmcclean commented 7 months ago

I've just tested this again. Even when using your project with a fresh database, I still can't reproduce the issue. The AJAX requests all return successfully.

Are you able to record a video? Maybe there's something I'm missing πŸ€”

Web10-Joris commented 7 months ago

I've shared you a video via email!

duncanmcclean commented 7 months ago

Hmm, I still can't reproduce it, even when following your video exactly...

[removed]

I have the latest commits pulled down from master and a completely fresh database. I wonder if there's any content changes you have on your side that I don't have on mine (since they're git ignored). Can you send me a zip file via email?

I'm sure you've tried it probably a dozen times but can you try clearing your cache in case something's stuck somewhere: php artisan cache:clear

If you clone down the project from scratch, can you still replicate?

Web10-Joris commented 7 months ago

Well yes, that's weird.

  1. I tried cloning my own repository in a new install (using the same content.zip that I've sent you). 2.Installed all composer packages via Sail and ran the container.
  2. ...and the same error occurs.

I indeed already cleared the cache multiple times. Any idea what could be the difference, or what can cause this issue (how to debug?)

Web10-Joris commented 7 months ago

I can send you the dd($cart->toAugmentedArray()) output just before passing it to $this->withSuccess() inside the CartController. Maybe you see something weird in there? I'm not sure what is the best (most convenient) way to share this. I've attached a .txt file with the cart data here. cart.txt

duncanmcclean commented 7 months ago

Thankfully, I've just updated my dependencies, cleared my caches, cleared the database and I can reproduce now. πŸŽ‰

Web10-Joris commented 7 months ago

Thankfully, I've just updated my dependencies, cleared my caches, cleared the database and I can reproduce now. πŸŽ‰

Haha okay! I was already starting to doubt myself πŸ˜…. Hopefully it's not something too difficult...

github-actions[bot] commented 7 months ago

Released as part of v6.0.9.

Web10-Joris commented 7 months ago

@duncanmcclean Thank you for fixing this so quickly! Can you maybe remove/hide the video recording in this issue? :)

duncanmcclean commented 7 months ago

@duncanmcclean Thank you for fixing this so quickly! Can you maybe remove/hide the video recording in this issue? :)

Done!