question

gytisbarakauskas avatar image
gytisbarakauskas asked

Title data acting weird just after updating it

Hello,
here's the situation: currently I have a title data key "CurrentChallenge" with a value that's just a single integer 0, 1, 2... But just after I change the value let's say from 2 to 3, it seems some time has to pass for the value to "settle". I know that docs says wait up to 15min because the values are cached, but that's not the problem. The problem is that in this 15min timeframe it seems the value is jumping between all the values that ever existed in this key value pair randomly. For example this is how it went last time:
1. Lets say value is set to "1".
2. I launch the game several times and print the downloaded value it's always "1". (correct)
3. I change the value in playfab console to "2".
4. Right after I launch the game and the downloaded value is "2". (correct)
5. Shut down the game, launch it again, the value is still "2". (correct)
6. Launch the game again, the value changes to "0" for no reason. (incorrect)
7. Relaunch again, the value is again the correct one "2". (correct again)
8. Launch again the value is "3" (incorrect)
This repeats for so time...

I am using Unity version 2019.1.11f with the latest playfab SDK (2.71.190821)


Calling it like this:

        PlayFabClientAPI.GetTitleData(new GetTitleDataRequest(), result =>
        {
            Debug.Log(result.Data["CurrentChallenge"]);
	})
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

We tested it via Client/Server API GetTitleData on the third-party REST API testing tool Postman and got the same result. Unity and Unity SDK seems to have no issue. After about 15-20 minutes, the Title data that we get will be stable. It seems to be caused by the Title data update mechanism. Title Data is a sharded and cached resource, so when you update it there's going to be a delay before all endpoints are updated with the latest information. You can navigate to this thread for some advice on the usage of Title data.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

gytisbarakauskas avatar image gytisbarakauskas commented ·

Well, it would be fine if the data would swap between the last one and the newest one. But as I said sometimes it will return a number that was entered even earlier. E.g. was "1", changed to "2", sometimes it will return "0", makes no sense to me.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang gytisbarakauskas commented ·

When we update the Title data too often (time interval is too short), this situation happens. It has no effect on the data we can get after 15 minutes. In the tests, it always would be the latest one.

But Title data should not be updated too frequently, and definitely cannot be used in any case where the update originates from a client action. Because Title Data is sharded and cached, if you have multiple sources updating it, they are going to collide causing data loss.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ gytisbarakauskas commented ·

To be clear, the value of Title Data will eventually be the one that you lastly update ( no matter from any endpoints) but like Sarah has mentioned, Title Data is a sharded and cached resource. It means it will take times (usually few minutes ) to make all shards updated and when you try to retrieve the Title Data, it can be any one of shards. The update progress of each shard is different, that's why when you call get title data very requently, you get several different values and these values can be retrieved from different shards.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.