Performance Issue: UI does not refresh even though the underlying data has changed

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.

Update:
I noticed that status on the UI does not change until a row is added or deleted in the “Kitchen Orders” table, which is where the current status of each order is a tracked.

I am guessing that inserting new row in the “Kitchen Order History” table does not notify Glide app the reevaluate the related row in the “Kitchen Orders”, even though there are relational columns in the “Kitchen Orders” table referring to the “Kitchen Order History” table.

How are you retrieving the status to show on the front end? Via a relation & single value column?

Via both. I have an one-to-many relationship column that fetches all history rows. then I use single value column that gets the last status value from from the relationship column. I am guessing that this could be the problem. Is that the reason for your question?

Thank you @ThinhDinh. Your question lead me to dive deep into these two columns and try alternate approaches. I was able to solve the issue by replacing the relation column with a query that fetches only the last related row from the history table. With this change, the UI shows the state changes instantly.

That’s still weird for me if your relation + single value column approach didn’t work. Glad that it’s working now though.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.