co-cart / co-cart

🛒 CoCart makes it easy to decouple your WooCommerce store via a customizable REST API that takes the pain out of developing – allowing you to build fast and flexible headless stores.

Home Page:https://cocartapi.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mixing carts between users

mexposito-agoravita opened this issue · comments

Prerequisites

  • I have carried out troubleshooting steps and I believe I have found a bug.
  • I have searched for similar bugs in both open and closed issues and cannot find a duplicate.

Describe the bug

When I add an item to cart_1, this item is also added to cart_2.
If I flush cart_2, cart_1 still has its item.
If I add another item to cart_1, cart_2 now has both items even though I previously flushed it.

I guess this issue could be related to my JWT authentication but I can't figure it out.

Expected behavior

Adding an item to my cart must not interfere with other carts

Actual behavior

Adding an item to my cart is adding the same item to other carts

Steps to reproduce

Make sure your 2 tests accounts have an empty cart

  1. Log in with account_1
  2. Add an item to cart
  3. Log out
  4. Log in with account_2

WEIRD BEHAVIOR 1 --> the previously item added to account_1 cart's is also in your account_2 cart's

  1. Flush your cart : it is now empty
  2. Log out
  3. Log in with account_1 : you still have your item in cart
  4. Add a second item to your cart
  5. Log out
  6. Log in with account_2

WEIRD BEHAVIOR 2 --> the previously flushed cart now has 2 items

WordPress Environment

WordPress Environment

WordPress address (URL):
Site address (URL):
WC Version:
REST API Version: âś” 7.1.1
WC Blocks Version: âś” 8.7.6
Action Scheduler Version: âś” 3.4.0
Log Directory Writable: ❌ Pour permettre l’enregistrement de journaux
rendez accessible en écriture ou définissez un WC_LOG_DIR personnalisé.

WP Version: ❌ - Une nouvelle version de WordPress est disponible (6.1.1)
WP Multisite: –
WP Memory Limit: ❌ - Nous recommandons l’augmentation de la mĂ©moire Ă  64Mo minimum. Voir : Augmenter la mĂ©moire allouĂ©e Ă  PHP
WP Debug Mode: –
WP Cron: –
Language:
External object cache: –

Server Environment

Server Info:
PHP Version: - ❌ WooCommerce utilisera cette version PHP bien que certaines fonctionnalitĂ©s comme la gĂ©olocalisation ne soient pas compatibles. La prise en charge de cette version sera abandonnĂ©e dans la prochaine version majeure. Nous recommandons d’utiliser PHP version 7.2 ou supĂ©rieur pour optimiser les performances et la sĂ©curitĂ©. Comment mettre Ă  jour votre version de PHP ?
PHP Post Max Size:
PHP Time Limit:
PHP Max Input Vars:
cURL Version:
SUHOSIN Installed: –
Max Upload Size:
Default Timezone is UTC: ❌ La timezone par défaut est - doit être UTC
fsockopen/cURL: ❌ Votre serveur n’a pas fsockopen ou cURL actifs - Paypal IPN et les autres scripts qui communiquent avec d’autres serveurs ne fonctionneront pas. Contacter votre hébergeur.
SoapClient: ❌ Votre serveur n’a pas la classe SoapClient activée - certaines extensions de passerelle utilisant SOAP peuvent ne pas fonctionner correctement.
DOMDocument: ❌ Votre serveur n’a pas la classe DOMDocument activée - les e-mails HTML/Multipart
et certaines extensions
ne fonctionneront pas sans DOMDocument.

GZip: ❌ Votre serveur ne supporte pas la fonction gzopen - Ceci est nécessaire pour utiliser la base de données GeoIP de MaxMind.
Multibyte String: ❌ Votre serveur ne supporte pas la fonction mbstring - celle-ci est obligatoire pour un meilleur encodage des caractères. Certaines alternatives seront utilisées pour cela.
Remote Post: ❌ wp_remote_post() a échoué. Contactez votre fournisseur d’hébergement.
Remote Get: ❌ wp_remote_get() a échoué. Contactez votre fournisseur d’hébergement.

Database

WC Database Version:
WC Database Prefix:
Information de la base de donnĂ©es :: Impossible de rĂ©cupĂ©rer les informations de la base de donnĂ©es. Ce n’est gĂ©nĂ©ralement pas un problème. Cela signifie simplement que votre installation utilise une classe qui remplace la classe de base de donnĂ©es de WordPress (par exemple
HyperDB) et que WooCommerce ne peut pas obtenir d’informations sur la base de données.

Security

Secure connection (HTTPS): ❌
Votre boutique n’utilise pas HTTPS. En savoir plus sur HTTPS et les certificats SSL.
Hide errors from visitors: ❌Les messages d’erreur ne doivent pas s’afficher aux visiteurs.

Active Plugins (0)

Inactive Plugins (0)

Settings

API Enabled: –
Force SSL: –
Currency: ()
Currency Position:
Thousand Separator:
Decimal Separator:
Number of Decimals:
Taxonomies: Product Types:
Taxonomies: Product Visibility:
Connected to WooCommerce.com: –
Enforce Approved Product Download Directories: âś”

WC Pages

Theme

Name:
Version:
Author URL:
Child Theme: ❌ – Si vous modifiez WooCommerce sur un thème parent que vous n’avez pas construit personnellement
nous vous recommandons d’utiliser un thème enfant. Voir : Comment crĂ©er un thème enfant

WooCommerce Support: ❌ Non déclaré

Templates

Overrides: –

Product Bundles

Database Version: 6.17.3
Loopback Test: ❌ Loopback test failed.
Template Overrides: –

Admin

Enabled Features: activity-panels
analytics
coupons
customer-effort-score-tracks
experimental-products-task
experimental-import-products-task
experimental-fashion-sample-products
shipping-smart-defaults
shipping-setting-tour
homescreen
marketing
multichannel-marketing
mobile-app-banner
navigation
onboarding
onboarding-tasks
remote-inbox-notifications
remote-free-extensions
payment-gateway-suggestions
shipping-label-banner
subscriptions
store-alerts
transient-notices
woo-mobile-welcome
wc-pay-promotion
wc-pay-welcome-page

Disabled Features: minified-js
new-product-management-experience
settings

Daily Cron: âś” Next scheduled: 2022-12-09 07:37:17 +01:00
Options: âś”
Notes: 71
Onboarding: completed

Action Scheduler

TerminĂ©: 11 060
Oldest: 2023-01-30 15:57:33 +0100
Newest: 2023-03-02 09:00:32 +0100

En attente: 2
Oldest: 2023-03-02 17:31:48 +0100
Newest: 2023-03-02 17:31:48 +0100

CoCart

Version: 3.7.9
Database Version: 3.7.9
Install Date: 4 October 2022
Carts in Session: 115
Carts Active: 4 out of 115 in session.
Carts Expiring Soon: 0 out of 115 in session.
Carts Expired: 111 out of 115 in session.
Carts Source (by CoCart): 111
Carts Source (by Web): 0
Carts Source (by Other): 4

Status report information

Generated at: 2023-03-02 09:33:41 +01:00

Isolating the problem

  • I have deactivated other plugins and confirmed this bug occurs when only CoCart plugin is active.
  • I can reproduce this bug consistently using the steps above.

@mexposito-agoravita Your WordPress environment report is incomplete and from the information that is there it's saying that certain things are not even meeting requirements, at least for CoCart.

Can you please provide an none edited version along with copies of the code you are doing for each step. Also include the JWT steps so I have the full picture. This report is just to vague.