Cloud Save data load is empty in WebBuild but fine in Editor

I save/load player progress in Unity Cloud save.
Works fine in Editor. Data is loaded as it was saved. I see it in the Cloud console.
But in the web build i receive empty item. And for sure I logged as correct user - the user id checked and environment is correct.

the method

private async UniTask<T> LoadDataAsync<T>(string key) where T : class
        {
            var savedData = await CloudSaveService.Instance.Data.Player.LoadAsync(new HashSet<string> { key });
            
            var wholeJson = JsonConvert.SerializeObject(savedData, _jSettings);
            Debug.Log($"Loaded data for key {key}:\n {wholeJson}");
            
            if (savedData.TryGetValue(key, out var value))
            {
                var valString = JsonConvert.SerializeObject(value, _jSettings);
                Debug.Log($"Loaded data for key {key}:\n {valString}");

                var jsonObject = JsonConvert.DeserializeObject<Dictionary<string, object>>(valString);
                if (jsonObject != null && jsonObject.TryGetValue("Value", out var valuePart))
                {
                    var valueString = JsonConvert.SerializeObject(valuePart, _jSettings);
                    var valObject = JsonConvert.DeserializeObject<T>(valueString);
                    return valObject;
                }
            }

            Debug.LogWarning($"No saved data found for key: {key}");
            return default;
        }

log in the Editor

Loaded data for key ProgressData:
{
“ProgressData”: {
“Key”: “ProgressData”,
“Value”: {
“Questions”: {
“Cold”: {

log in browser console

UnityCloudDataProvider.cs: Loaded data for key ProgressData:
{
“ProgressData”: {}
}

I even can play in browser - create user, save some progress. Then login with this user in editor and load the progress. But the progress is empty when I load it in web build.

Why?

Every time you make a remote service call you HAVE to enclose it in try/catch. For one simple reason: it is valid for service calls to fail, be it because the user’s Internet went offline or the services experience a downtime. Your app needs to respond to that accordingly and the only way to do so is by catching the service exceptions!

Do add those try/catch and check if any exceptions are being reported.

added try catch.
No errors catched.
The problem still persists.

Well I finally find out.
I was trying to get actual saved value as dictionary and then deserialize and it worked in the editor.

For web build I serialize / deserialize value.Value into T and it works in editor and web build

private async UniTask<T> LoadDataAsync<T>(string key) where T : class
        {
            try
            {
                var savedData = await CloudSaveService.Instance.Data.Player.LoadAsync(new HashSet<string> { key });
                var rawJson = JsonConvert.SerializeObject(savedData);
                Debug.Log($"Loaded raw data for key: {key}:\n{rawJson}");
            
                if (savedData.TryGetValue(key, out var value))
                {
                    var jsonString = JsonConvert.SerializeObject(value.Value, _jSettings);
                    Debug.Log($"Extract type: {typeof(T).Name}, for key: {key}:\n{jsonString}");

                    var deserializedObject = JsonConvert.DeserializeObject<T>(jsonString);
                    return deserializedObject;
                }
                
                Debug.LogWarning($"No saved data found for key: {key}");
                return default;
            }
            catch (Exception e)
            {
                Debug.LogError($"Error on loading data for key: {key}\n{e}");
                HandleError(e);
                return default;
            }
        }