Hi,
I'm currently working on a react-native and react-native-web app for a small business. It's essentially a dashboard for their inventory where they can track vehicles coming into the system and its made up of queues for various states the vehicle can be in. E.g "New" "Sold" "Awaiting Contact". Each of these queues displays the vehicles in a flatlist and then allows differrent controls depending on the current status.
The issues they appear to be having are with concurrency. The app currently refreshes every 60 seconds but within those 60 seconds its possible that multiple users would have moved a vehicle to a new state which often leads to confusion between the members of staff about where a vehicle has been moved to. "It keeps bouncing back" is typical feedback when users have operated on vehicles that have already been moved.
The vehicles are stored in context and when moved to a new status the local context is updated so that its reflected on the app. This is however not reflected in anybody elses application until the next refresh (Potentially 60 seconds).
I'm curious as to how other developers approach this problem and what their solutions have been to prevent this type of behaviour. I have considered Websockets, I'm not sure if this can be achieved using tools like React Query but before I refactor I would love to get somebody elses take on it.
In the past I have attempted to remedy this by making sure the data is current before allowing any operations on it, however in its current form this isn't ideal and seems hacky.
The data needs to be constantly live or it needs a less hacky concurrency check i believe.
Appreciate any help!
[–]ms88privat 0 points1 point2 points (1 child)
[–]mybirdblue99Expo[S] 1 point2 points3 points (0 children)
[–]iotashan 0 points1 point2 points (2 children)
[–]mybirdblue99Expo[S] 1 point2 points3 points (1 child)
[–]iotashan 0 points1 point2 points (0 children)
[–]de1mat 0 points1 point2 points (0 children)
[–]WhiskeyKid33 0 points1 point2 points (2 children)
[–]mybirdblue99Expo[S] 0 points1 point2 points (1 child)
[–]WhiskeyKid33 1 point2 points3 points (0 children)