I have a messaging component within my app. When a user sends a message it would create message per the conversation. The problem i am running into is that the list of messages does not update after the message is sent.
What is the proper workflow to have the list of messages update after the user sends a message?
This is most likely because we cache API calls that don’t change - so if the call to get all messages doesn’t include any parameters that will change with each “display list” action, the list won’t update to reflect the current data. Assuming that you have a repeating group set up that makes a GET call to a list of messages from an API, I’d take the following steps:
Add a parameter to the GET call that will always be unique every time the call is made. A millisecond timestamp parameter is a good option for this.
In the workflow that creates a new message, make sure to add a “display list” action to re-call the API in the repeating group.
With the addition of the new parameter, the call will be different from the last, and so we’ll no longer pull from the cache, but instead, we’ll make a new call and get the updated messages.