I've set it up so that when a client sends an EndRound request this cloud script handler takes care of some magic, writes an event to Playstream and gives a response to client. However, I've deferred storing the level progress to a Rule that triggers only on successful EndRound's and calls a different cloud script handler that syncs and persists the level progress to player read only data. So far it has worked quite well.
Here comes the tricky part: We allow offline play which means that whenever a client comes online again it may have any number of EndRounds stored locally that it will try to sync to PlayFab backend. To avoid clients spamming backend with 20, 30, 40 requests (one per round played) we bundle them in fewer requests (currently up to 20 EndRounds per request) and cloud script loops through and takes care of them one after the other.
Now remember how each EndRound results in a PlayStream event that triggers other cloud script to store level progression? Level progression is also stored in bundles, sort of like episodes if you will, so different playstream calls (per individual level) may try to update the same object (different levels in same episode) in player read only data...
So my question is if there are any guarantees from PlayFab side of these calls triggered from PlayStream rules are being handled sequentially? Cause if there is any chance of parallellism I'm gonna have to re-think a lot of this I'm afraid...
I've done some light testing and it seems to work but I'm still worried and I'm not sure any amount of testing I can perform myself will completely take that worry away :)
Many thanks, Oskar