Let’s say, I am saving a player’s data with DataStore:UpdateAsync() when they leave the game, and let’s say it fails to save, so it retries for like 30 more seconds, sending more UpdateAsync calls until the save is successful.
Before the save request even finishes successfully, the player leaves and manages to join the same server again, triggering the server to load their data. However, because the save request hasn’t finished, the server loads the player’s old data. So now, when the player continues to play, they’ll be overwriting their new data (the data that the save request took some time to complete) when they leave the game again or whenever a save occurs.
What kind of solutions r there to go about this? How do u ensure that the server accesses player data only after previous datastore requests are finished?
I’m not looking for datastore module suggestions if that’s what you were gonna comment :]