Describe the bug
When the first call to CommerceService is a GetCurrent() invocation with no scope supplied, the await never gets fulfilled.
To Reproduce
using System.Threading.Tasks;
using Beamable;
using UnityEngine;
using UnityEngine.UI;
public class ListingsGetCurrentSlow : MonoBehaviour
{
public Button PrimaryButton;
private BeamContext _beamable;
private async void Start()
{
await InitializeBeamable();
PrimaryButton.onClick.AddListener(OnPrimaryButtonClicked);
Debug.Log("BeamContext ready. Go ahead and click");
}
private async void OnPrimaryButtonClicked()
{
Debug.Log("Primary button clicked");
await GetListings();
}
private async Task InitializeBeamable()
{
_beamable = await BeamContext.Default.Instance;
}
private async Task GetListings()
{
Debug.Log("Doing GetCurrent in CommerceService");
var storeView = await _beamable.Api.CommerceService.GetCurrent();
Debug.Log($"Got store view with {storeView.listings.Count} listings.");
foreach (var listingView in storeView.listings)
{
Debug.Log($"LISTING: {listingView.symbol}");
}
}
}
Expected behavior
await ctx.Api.CommerceService.GetCurrent(); returns fast and yields a fully populated, meaningful StoreView data structure.
Actual behavior
await ctx.Api.CommerceService.GetCurrent(); never returns, thereby rendering it useless.
Metadata
- SDK version: 1.19.21
- Engine version: Unity 2021.3.27f1
- Operating System: macOS
Describe the bug
When the first call to
CommerceServiceis aGetCurrent()invocation with no scope supplied, theawaitnever gets fulfilled.To Reproduce
Expected behavior
await ctx.Api.CommerceService.GetCurrent();returns fast and yields a fully populated, meaningfulStoreViewdata structure.Actual behavior
await ctx.Api.CommerceService.GetCurrent();never returns, thereby rendering it useless.Metadata