Closed MikeAlhayek closed 1 year ago
Yes, shape descriptors are cached among all tenants, then the shape table including descriptors and binding strategies is cached per tenant theme, so the strategy injection is only needed when first building the shape table, but somewhere they are tied to features so that if a feature is disabled the related strategy is not concretely executed (if this strategy is tied to this feature).
@jtkech Very strange to cache descriptors across all tenants like this. Is there a good reason to do that instead of caching it per tenant... we'll beside the extra memory/cache storage?
But event when we cache them across all tenants, we should only execute the descriptors based on current tenants enabled features not installed features.
Across all tenants not in the memory cache, for perf so that a shape descriptor is built once even if it is no longer used. In the memory cache of a given tenant we only set the shape table with descriptors and strategies related to a given tenant (and their related features) and per theme.
Also sharing descriptors decreases a lot memory allocations.
You don't need feature attribute on shapetableprovider if there is only one shapetableprovider in a module and there no multiple feature in a module
Describe the bug
I have the following startup class
If I enable the
CrestApps.Components.User.Avatars
feature, theAvatarShapeTableProvider
is registered correctly. If I disable the feature after that, the ShellContext is released. However, theAvatarShapeTableProvider
does not get removed from the IoC even when theAvatarStartup
does not get called again. It's like it gets cached or registered in a globalIoC
container instead of the tenant's container which is very strange.To solve the problem, I had to explicitly add the
[Feature("CrestApps.Components.User.Avatars")]
to theAvatarShapeTableProvider
class.It is my understanding that
[Feature("...")]
attribute is required on the controller only.@jtkech have you seen this issue before? It is very strange to have to add
[Feature("...")]
for every implementation ofIShapeTableProvider
. UsingConfigureServices()
should be all that we have to do.