Hey Bubblers,
For context, this app has products and shopping carts like a marketplace.
The shopping cart repeating group has been behaving weird recently. It suddenly doesn’t show the second item although it has been created in the database already.
To help you guys better visualize the scenario, the flow is simply like this:
- User clicks add to cart
- If there is an order with that product, merge the orders by simply adding to the order’s quantity
- If there are no orders with that product, create a new order
Note: The shopping cart RG’s data source isn’t a list but is a search wherein it searches for orders with a couple of constraints
When does the issue happen?
When the user tries to order for the first time, it all works well and the order shows up in the RG. However, when the user makes another order, it suddenly doesn’t show up in the RG although it has been created in the database already.
Refreshing the page, would completely hide the two items in the RG (the things are still in the DB though!)
How the issue suddenly solves itself
The 2 hidden items in the RG suddenly appears again if you:
- Create a different order with a different product to the cart making it 3 or more items
- Refresh the page
The issue suddenly vanishes and all the orders show up in the RG if you have 3 or more items in the RG. Trimming (deleting) it down to 2 or less than 2 items and refreshing it would make the issue appear again.
I have a group with a notification that is set to show only if repeating group is empty but it doesn’t show up while the items are hidden, explaining that the items are still there…just not visible in the UI?
Upon checking the debugger, it shows that the RG’s data source is empty even if the things exist in the DB!
At first, I thought this was a either a mistake in our expression or a privacy rules issue but its not. It only happens if RG’s number if items is 2 or less than 2
Also, the “hidden items”, although can be modified via search, doesn’t notify the action “trigger a custom event when data changes”
Here’s a quick loom video of the issue in action:
Would greatly appreciate any insights. Thanks!