Base solution for your next web application
Open Closed

Feature Management Not Working When Redis Cache Enabled In v13.1.0 #11899


User avatar
0
rickfrankel created

Hi,

  1. Downloaded a new and empty v13.1.0 solution from the website.
  2. Run the angular front end (no changes just a yarn install).
  3. Open the backend solution and enable Redis (uncomment lines 105-109 in XXXWebCoreModule.cs)
  4. Run the backend
  5. Login to the site
  6. Go to tenants
  7. And edit the features on the Default tenant.
  8. Enable the [Test tenant scope feature]
  9. Click Save
  10. Open the edit features on the Default tenant modal again
  11. The feature is not enabled.
  12. You can do this over and over and it won't enable the feature in the UI or in the actual code.

HOWEVER the feature is enabled in the DB and in Redis itself. It's just that when you get that feature back from redis it won't be set to true for some reason.

We've tried debugging the aspnetboilerplate to find where this goes wrong and we couldn't narrow it down.

Thanks Rick


6 Answer(s)
  • User Avatar
    0
    rickfrankel created

    Further debugging has found this is a problem due to the updates to the serialization as well.

    See this fiddle to show the issue. https://dotnetfiddle.net/SoyH6m

  • User Avatar
    0
    rickfrankel created

    The issue is the private setter on the TenantFeatureCacheItem FeatureValues property.

    If I remove the private setter and make it public then System.Text.Json can deserialize it correctly to the object required.

    With the private setter it does not work.

  • User Avatar
    0
    rickfrankel created

    https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/migrate-from-newtonsoft?pivots=dotnet-9-0#non-public-property-setters-and-getters

    You can either mark it as [JsonInclude] or you need to remove the private setter.

    Can you also please search the rest of the code for where this could be an issue. An urgent hotfix would be greatly appreciated as 13.1.0 is currently broken with features and redis.

    Thanks Rick

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi Rick,

    We will fix 9.1.2 as soon as possible, so you can upgrade the NuGet packages and solve this problem. Please follow https://github.com/aspnetboilerplate/aspnetboilerplate/issues/6901

  • User Avatar
    0
    rickfrankel created

    Thank you :) We're still going through our full round of testing and updates to our project to 13.1.0. Will let you know if we find anything else. I'm watching that github issue now.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks :), we will be releasing this fix in 1-2 days.