Okay, I have now recreated the scenario and attempted to reproduce the issue. However, it has now worked as intended and no entries were deleted from the database. I suspect that during my initial test, I made the change directly in the database and the cache had not yet been synchronized before I made the next change in the application.
Thanks for your help.
Unfortunately, we are unable to update at this time. Therefore, I would appreciate a response regarding how the framework behaves (in version 8.3.4). You may also simply confirm whether my following statements are correct or not.
However, my last two questions have nothing to do with the cache.
What can you say about that?
I have also identified a second problem. When I change the features of the assigned edition, the individual value of the tenant is deleted from the database and the value of the edition is applied.
It is very dangerous that settings are lost... is this the desired behavior?
Ok, thank you.
I now have the following problem:
Are no feature values of the edition applied as soon as a value is “overwritten” on the tenant?
I assumed that only this value (Identity.MaxUserCount) differs from the values of the edition?
So you don't know how long the entries in the cache are valid by default?
I don't want to implement a special function for this individual case. If I did, I would have to override the standard behavior so that the field is not deactivated in the features on the tenant.
Are there any other ways to force synchronization (e.g., restarting the app)? Or does this happen regularly in the background as a job?
Oh, I guess it has something to do with synchronization in the cache. When I checked again after a while, the value I had entered in the DB was there.
What is the default frequency for DB and cache synchronization? Can this be forced?
Hmm... but I tried to achieve this on a experimental way by creating a corresponding database entry in the AbpFeatureValues table for this tenant. That didn't work, and the old value was still displayed in the UI.
You can call the
await InvokeAsync(StateHasChanged)after changing theSelectedTenantId. Ensure the input has set the correct value.
The problem was that the DOM had not yet been updated at that moment. I solved it as follows:
<form method="post" action="Account/ImpersonateTenant" id="impersonateTenantForm">
<input type="hidden" name="TenantId" value="@SelectedTenantId" />
<input type="hidden" name="TenantUserName" value="admin" />
</form>
private Guid SelectedTenantId { get; set; }
private bool ShouldSubmitImpersonateTenantForm { get; set; } = false;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
// Submit the impersonateTenantForm after setting the tenant ID
if (ShouldSubmitImpersonateTenantForm)
{
ShouldSubmitImpersonateTenantForm = false;
await JS.InvokeVoidAsync("submitForm", "impersonateTenantForm");
}
}
private async Task OnImpersonateTenantClick(Guid tenantId)
{
SelectedTenantId = tenantId;
ShouldSubmitImpersonateTenantForm = true;
await InvokeAsync(StateHasChanged);
}
function submitForm(formName) {
var form = document.getElementById(formName);
form.submit();
}