You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I do await ctx.Stats.Refresh(); before interacting with the Stats collection, I expect the stats to reflect the latest and greatest values of those stats, but if the stat were changed server-side, the Stats collection contains stale data until I stop and start the app.
To Reproduce
Steps to reproduce the behavior:
Set a stat to a certain value.
Iterate over the Stats collection to print the value.
Use C#MS code to change the stat from step 1 to a different value.
Call Stats.Refresh() and iterate over the collection to print values again.
Observe the value of the stat.
Expected Behavior
The value in the Stats collection should reflect the change from step 3 of the repro steps.
Actual Behavior
The value in the Stats collection shows the old value from step 1 of the repro steps.
Sample Code
Client Code
These calls are hooked to buttons in my test harness.
privateasyncTaskSetRandomStat(){varclient=newBoxMicroserviceClient();vartheNumber=awaitclient.SetNumericStat();Debug.Log($"Numeric stat setting completed: {theNumber}");}privateasyncTaskFetchStats(){varctx=awaitBeamContext.Default.Instance;awaitctx.Stats.OnReady;Clear();Debug.Log("Reading current stats...");awaitctx.Stats.Refresh();foreach(varstatPairinctx.Stats){Debug.Log($"S: {statPair.Key}={statPair.Value}");}}
Server Code
[ClientCallable,SwaggerCategory("StatsTests")]publicasyncTask<int>SetNumericStat(){varobjectId=$"client.public.player.{Context.UserId}";vartheNumber=Randomizer.Next();varstatsRequest=newNumericStatsUpdateRequest{set={["NUMERIC_SOMETHING"]=theNumber}};varuri=$"/object/stats/{objectId}";varresponse=awaitRequester.Request(Method.POST,uri,statsRequest,parser: s =>s);Debug.Log($"RESPONSE: {response}");returntheNumber;}
Screenshots
Metadata
SDK version: Beamable Unity SDK 1.19.23
Engine version: Unity 2021.3.27f1
Operating System: macOS
Additional Context
The new value is reflected properly if the app is closed and reopened.
The text was updated successfully, but these errors were encountered:
Describe the Bug
When I do
await ctx.Stats.Refresh();
before interacting with the Stats collection, I expect the stats to reflect the latest and greatest values of those stats, but if the stat were changed server-side, the Stats collection contains stale data until I stop and start the app.To Reproduce
Steps to reproduce the behavior:
Stats
collection to print the value.Stats.Refresh()
and iterate over the collection to print values again.Expected Behavior
Stats
collection should reflect the change from step 3 of the repro steps.Actual Behavior
Stats
collection shows the old value from step 1 of the repro steps.Sample Code
Client Code
These calls are hooked to buttons in my test harness.
Server Code
Screenshots
Metadata
Additional Context
The new value is reflected properly if the app is closed and reopened.
The text was updated successfully, but these errors were encountered: