It would be great if we can have this feature.
It would be useful in preventing concurrency.
For example, I have one claimDailyRewards cloudscript function which gives reward to user in their inventory.
I want to give user reward only 1 time during day, so for that i am using DAILY_REWARD_STATS key for storing daily timer details and no of day.
Here the main problem is if two concurrent request from same user come then there are high chances that both request add rewards to user.
I am using below code. As you can see i am updating readonly data as soon as current data validation completed.
const combinedData = server.GetPlayerCombinedInfo({ PlayFabId: currentPlayerId, InfoRequestParameters: { GetUserReadOnlyData: true, UserReadOnlyDataKeys: [UserReadonlyDataKeys.DAILY_REWARD_STATS], GetUserVirtualCurrency: true, }, }).InfoResultPayload; const userReadonlyData = combinedData.UserReadOnlyData; const userBalance = combinedData.UserVirtualCurrency; if (!userReadonlyData[UserReadonlyDataKeys.DAILY_REWARD_STATS]) { throw new Error('You are not yet eligible to claim reward'); } server.UpdateUserReadOnlyData({ PlayFabId: currentPlayerId, KeysToRemove: [UserReadonlyDataKeys.DAILY_REWARD_STATS], });
Stills it won't be enough to prevent concurrent requests.
But using this feature we can prevent concurrent requests.