Openfoodnetwork: incorrect product displayed in multi OC shop

Created on 22 Apr 2021  路  4Comments  路  Source: openfoodfoundation/openfoodnetwork

Description

Enterprise ID : 998

A shop with 3 OC opened simultaneously, with 3 identicals product's content
Capture d鈥檈虂cran 2021-04-22 a虁 16 12 18

Expected Behavior

Products diplaying identical in the shop for the 3 OC

Actual Behaviour

The shop displaying 20 products for the 1st OC "Commande des plants pour le 30 avril"
Capture d鈥檈虂cran 2021-04-22 a虁 16 12 18

When swicth from the top right button or the 2nd OC "Commande pour le 14 mai" the shop displaying 20 products
Capture d鈥檈虂cran 2021-04-22 a虁 16 19 25

But, when you switch for the third OC "Commande pour le 28 mai" the shop displaying 10 products.
So, It missed 10 products, the displaying stopped to the tenth product " poivron Corno Di Toro Roux "

Capture d鈥檈虂cran 2021-04-22 a虁 16 22 24

Steps to Reproduce

  1. To the shop https://www.coopcircuits.fr/le-potager-de-saint-inn/shop
  2. Consult products
  3. Change OC from the first to the third
  4. Compare products

Animated Gif/Screenshot


Workaround

Ask client to reload the web page

Severity

bug-s3: a feature is broken but there is a workaround

https://github.com/openfoodfoundation/openfoodnetwork/wiki/Bug-severity
-->

Your Environment

  • Browser name and version: Firefox 87.0 (64 bits) and Chrome Version 89.0.4389.128

Possible Fix

bug-s2

Most helpful comment

The issue is: we don't change the $scope.page parameter to 1 if we do change order_cycle thought the order cycle component

All 4 comments

I can replicate the issue in that shop :+1: If I reload the page or switch back and forth between the tabs, it then shows all the products (not just those first 10). Seems inconsistent, like it doesn't always happen. Nothing in Bugsnag at all (which seems strange).

I think products not loading in a shop is at least an S2.

Thanks @Matt-Yorkley !

I can't reproduce it on my machine (still need to done some more configuration), but what I can see from production, is the next scenario:

___Before__: refresh the page, and go to the shop_

_Step 1: select one OC_
First request is requesting the tenth first product, and the second one (immediatly after, not after scrolling the page or whatever) is requesting the following ten (page=2&per_page=10)
Capture d鈥檈虂cran 2021-04-23 a虁 11 45 00

_Step 2: change to another OC_
The first request is the same, then, just after, we have 2 identical requests (one to the other and to the previous one, because of the parameters: page=1&per_page=10)
Capture d鈥檈虂cran 2021-04-23 a虁 11 45 07
Just after a scroll on products, then we have the following request:
Capture d鈥檈虂cran 2021-04-23 a虁 11 51 23
which seems to be legitimate as we scroll down to the next 10 products.

_Step 3 : change to another OC_
Only the first request, and nothing happen (scrolling or not):
Capture d鈥檈虂cran 2021-04-23 a虁 11 45 26

The issue is: we don't change the $scope.page parameter to 1 if we do change order_cycle thought the order cycle component

Was this page helpful?
0 / 5 - 0 ratings