I am not sure if this is a performance issue to begin with, because the UI seems to perform well expect some in specific scenarios.
Background
I am working on a restaurant portal that can be used to track inventories, recipes, menu costing and kitchen orders. I am using Glide tables (no external data sources). I do have some javascript code hosted on GitHub public pages. These are working fine.
In order to track the order status, I am using following tables:
- Kitchen Orders - A row will be added here for every order that must be cooked.
- Kitchen Order Items - This is used track the ingredients used to cook a recipe.
- Kitchen Order History - A row will be inserted here every time the order status changes.
- Kitchen Order Workflow - A static table with Previous Status (as comma separated list) and the next status.
Workflow is as follows:
- Pending - New order. The user will tap a button to start working on the order, which will run an action to insert a row into the Kitchen Order History table, moving the status to “Preparing”.
- Preparing - All required materials for the recipes will be selected and measured during this stage. When everything is ready, the user will tap on a button to trigger an action, which will run an action to insert a row into the Kitchen Order History table, moving the status to “Cooking”
- Cooking - The recipe is being cooked. The user will add row using a form to move the state from here.
- Tasting - At least two other folks will have to taste the food before approving the order by adding another row (using a form) to “Completed” state.
- Completed - Food has been cooked.
Issue
The problem I am noticing is that when the status is moved to “Cooking” or “Completed”, the UI is still showing the old status. When I inspect the underlying tables, the status is correct there. After waiting about 10 to 15 mins, the UI reflects the correct state.
Is this because I am inserting some of the history rows using an action? I am not sure how to diagnose the problem here.