Hi, we have an issue with GetSettingValueForUserAsync not returning an updated value. It appears to be returning a cached value.
We are using the below line to change/ set a new setting value:
await SettingManager.ChangeSettingForUserAsync(AbpSession.ToUserIdentifier(), AppSettings.WMS.InventoryStockViewSettings.InventoryLotGroupBy, ((bool)input.InventoryLotGroupBy).ToString());
Then we are using the below to get the updated value from DB:
userSettings.InventoryLotGroupBy = await SettingManager.GetSettingValueForUserAsync<bool>(AppSettings.WMS.InventoryStockViewSettings.InventoryLotGroupBy, AbpSession.ToUserIdentifier());
The API endpoint for getting Updated values is returning old values to the client side most of the time (the values have been updated as expected in DB). It works fine after I hard reload the page/Frontend.
Note: Everything works fine on local, the issue is occurring only on live (Azure app service).
7 Answer(s)
-
0
Hi @lschelvan
Do you host more than 1 instance of your app on Azure ?
Thanks,
-
0
Currently there is only 1 instance.
-
0
Hi @lschelvan
Could you also share the setting definition of
AppSettings.WMS.InventoryStockViewSettings.InventoryLotGroupBy
, we will try to reproduce this problem on our side.At the moment, I don't have a clue about the problem yet.
-
0
Here's the definition. We have several other similar settings that are being read in the same manner, and they exhibit the same caching behavior.
public bool? InventoryLotGroupBy { get; set; } = false;
-
0
Hi,
I mean the setting definition in AppSettingProvider.cs, could you share that as well ?
-
0
new SettingDefinition( AppSettings.WMS.InventoryStockViewSettings.InventoryLotGroupBy, GetFromAppSettings(AppSettings.WMS.InventoryStockViewSettings.InventoryLotGroupBy, "false"), scopes: SettingScopes.User, isVisibleToClients: true, isEncrypted:false),
-
0
Hi @lschelvan
Thanks. Unfortunately, we couldn't reproduce this problem on our side. Is it possible to access your live app with a test account ? If so, could you share it with [email protected] ?