In my app two or more users can see and manipulate the same data by adding, editing or deleting records.
Say two users, Bob and Alice are both looking at the same page, which contains a list of records fetched from a custom API (thus a data variable). Bob then decides to delete a record off the list, which he can do without leaving the page. At the moment, this sends a DELETE
call to the API which removes the record while the variable is also updated using the following formula: WITHOUT_ITEM(data.Records, current)
.
My question is, how can then Alice (who has been staring at the same page on her device the whole time) automatically see the updated list which no longer has Bob’s record? At the moment, Alice has the option to manually trigger a refresh by tapping on a button within the page.
However, what if Alice decides to edit (or delete) the record that Bob deleted but it still shows up in her UI? The API will still return an error as the record’s id no longer exists, however this would lead to a poor UX, so what would be a better solution?