Search Unity

Bug Keys not found on ConfigOrigin.Remote

Discussion in 'Unity Remote Config' started by Jumeuan, Dec 12, 2019.

  1. Jumeuan

    Jumeuan

    Joined:
    Mar 14, 2017
    Posts:
    39
    Hi, i'm currently use Remote Config for my game. It's work, but have some bugs what i found here:

    1/ Dupplicate trigger FetchCompleted

    Code (CSharp):
    1. // Use this for initialization
    2.     protected override void Awake()
    3.     {
    4.         base.Awake();
    5.  
    6.         // Add a listener to apply settings when successfully retrieved:
    7.         ConfigManager.FetchCompleted += ApplyRemoteSettings;
    8.  
    9.         // Fetch configuration setting from the remote service:
    10.         ConfigManager.FetchConfigs<UserAttributes, AppAttributes>(new UserAttributes(), new AppAttributes()
    11.         {
    12.         });
    13.     }
    14.  
    15.     void ApplyRemoteSettings(ConfigResponse configResponse)
    16.     {
    17.         // Conditionally update settings, depending on the response's origin:
    18.         switch (configResponse.requestOrigin)
    19.         {
    20.             case ConfigOrigin.Default:
    21.                 Debug.Log("ConfigOrigin.Default:");
    22.                 break;
    23.             case ConfigOrigin.Cached:
    24.                 Debug.Log("ConfigOrigin.Cached");
    25.                 break;
    26.             case ConfigOrigin.Remote:
    27.                 Debug.Log("ConfigOrigin.Remote");
    28.                 break;
    29.         }
    30.     }
    Results on editor and real devices:
    Code (CSharp):
    1. ConfigOrigin.Cached
    2. ConfigOrigin.Remote
    3.  
    2. Settings is empty on ConfigOrigin.Remote:
    Code (CSharp):
    1. // Use this for initialization
    2.     protected override void Awake()
    3.     {
    4.         base.Awake();
    5.  
    6.  
    7.         // Add a listener to apply settings when successfully retrieved:
    8.         ConfigManager.FetchCompleted += ApplyRemoteSettings;
    9.  
    10.         // Fetch configuration setting from the remote service:
    11.         ConfigManager.FetchConfigs<UserAttributes, AppAttributes>(new UserAttributes(), new AppAttributes()
    12.         {
    13.         });
    14.     }
    15.  
    16.     void ApplyRemoteSettings(ConfigResponse configResponse)
    17.     {
    18.         // Conditionally update settings, depending on the response's origin:
    19.         switch (configResponse.requestOrigin)
    20.         {
    21.             case ConfigOrigin.Default:
    22.                 Debug.Log("ConfigOrigin.Default:");
    23.                 break;
    24.             case ConfigOrigin.Cached:
    25.                 Debug.Log("ConfigOrigin.Cached");
    26.                 break;
    27.             case ConfigOrigin.Remote:
    28.                 if(ConfigManager.appConfig.GetKeys().Length <= 0)
    29.                        Debug.LogError("Keys not found! " );
    30.                 break;
    31.         }
    32.     }
    Results on editor and real devices:
    Code (CSharp):
    1. 1st: No error
    2. 2nd: No error
    3. 3rd: Keys not found!
    4.  
    5. It's not frequently
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We are aware of the duplicate fetches. Can you share a screenshot of your Development settings in the Editor Remote Config dialog? Was this working previously? We are looking into the intermittent data
     
  3. Jumeuan

    Jumeuan

    Joined:
    Mar 14, 2017
    Posts:
    39
    Hi, my settings is just simple default key/value string. Like what i determine above, it's trigger "ConfigOrigin.Remote", but it's not return data. Yes, it's working previously, and error is not frequently show up. You can see it's work on normal on 1st, 2nd, but fail on 3rd. Then on 4, 5, 6 try times, it's working, but suddenly on 7 try times, it's fail.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you share a screenshot of your Development settings. You have the debug output "It's not frequently" but I'm not seeing that in your code, perhaps it was just an inline comment? Please post the actual debug output.
     
  5. VoxelMatt

    VoxelMatt

    Joined:
    Apr 22, 2015
    Posts:
    42
    Hi Jeff,

    I'm getting the same issue. My game can make several calls to remote config just fine... and then randomly a couple of calls will return Remote & Success - but there is no keys or data.

    I don't have any steps to reproduce, and it seems quite random. eg. I might get 8 calls in a row return with data. and then 2 in a row return empty - and then it gets the data again on the next call.
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I just tested and it looks to be working correctly here. Is this still happening? Was this working for you previously?