ASP.NET CORE MVC & JQuery v12.0.1 .NET 7
Edition feature settings are not saved when setting the value back to it's default value.
Steps to reproduce:
- Ensure you have an edition with at least one feature with a default value (for example, enable chat with a default value of true):
- Edit an edition and change the setting to false.
- Edit the edition again and change back to true (default value). The setting does not get saved. The same applies when setting textboxes etc. back to their default values.
Having to remove the default values from AppFeatureProvider to get around this which is far from ideal. Especially when evaluating a feature setting that hasnt had a value saved against it yet.
I can debug it as far as the EditionManager:
public virtual Task SetFeatureValueAsync(int editionId, string featureName, string value)
{
return _featureValueStore.SetEditionFeatureValueAsync(editionId, featureName, value);
}
But then lose the trail into ABP Source code.
Thank you
9 Answer(s)
-
0
Hi @Astech
Do you mean, if you select the default value (true for example), is the previous record with value false is removed from database ? If so, this is the default behaviour of the framework.
Or, does this cause any issues on your app ?
-
0
It's causing problems. If setting back to the default value, it does not get the value correctly. It's as if the IAbpZeroFeatureValueStore is caching when setting back to the default value.
Restarting the application resolves the issue but this is obviously not a viable solution.
Thanks
-
0
-
0
Possibly related to https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1433
and https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1574 ?
-
0
Hi @Astech
These are very old issues, I'm not sure if they are related. I have a few questions to understand the problem.
- Do you use Redis or in-memory cache ?
- Do you have more than 1 instance of your app on production ? (I assume you get this error on production)
- Can you reproduce this error on devleopment ? If so, could you share the steps ?
Thanks,
-
0
Thanks @ismcagdas
I have narrowed the problem down to AbpFeatureValueStore. I have moved all methods to our own FeatureValueStore so we can debug and make any necessary changes.
I can see that a cache is being used for the retreival of setting values and I think this may be the issue. Is there a way of disabling this or perhaps forcing a re-get of the value? And would this have any negative effects on perofrmance?
Thanks
-
0
We have resolved this by moving the GetEditionValueOrNull and GetEditionValueOrNullAsync methods from the FeatureStore up into the EditionManager. We have then stopped using the cache manager and just doing a call to the repository to get the value everytime. This is getting rid of the cache manager and related issue:
<br>
-
0
-
0
Hi @Astech
Thanks for the update. Is it possible for you to answer these questions ?
- Do you use Redis or in-memory cache ?
- Do you have more than 1 instance of your app on production ? (I assume you get this error on production)
Thanks,