Activities of "mert.kir"

hi

Please share the full error stack and the code of EntityDomainService

Thanks.

Hi

I share the codes in a masked form. If you need a clear version and more details, I can send it via e-mail or private ticket.

There is no problem when calling the following DomainService from AppService. However, from within DbMigrator _serviceProvider.GetRequiredService<IEntityDomainService>(); When called like this, an error is received.

Share your domain service?

It seems it is not registered to DI, perhaps you forgot to extend the DomainService base class.

I use Abp's DomainServiceand IDomainServiceclasses as base. There is no problem while the Http API project is running. But the DbMigrator project cannot resolve DI. Because DbMigrator cannot access the Domain layer by default.

Hello, I added the following code to the HttpApiHostModule and IdentityServerModule files. It works when I debug the line of code. However, after setting the tenant information to null, "tenant not found!" redirects to the page.

Configure<AbpAspNetCoreMultiTenancyOptions>(options =>
{
    options.MultiTenancyMiddlewareErrorPageBuilder = async (context, exception) =>
    {
        // Try to delete the tenant's cookie if it does not exist or is inactive.
        var tenantResolveResult = context.RequestServices.GetRequiredService<ITenantResolveResultAccessor>().Result;
        if (tenantResolveResult != null &&
        tenantResolveResult.AppliedResolvers.Contains(CookieTenantResolveContributor.ContributorName))
        {
            var options = context.RequestServices
            .GetRequiredService<IOptions<AbpAspNetCoreMultiTenancyOptions>>().Value;
            AbpMultiTenancyCookieHelper.SetTenantCookie(context, null, options.TenantKey);
        }
        
        context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
        context.Response.ContentType = "text/html";
        
        var message = exception.Message;
        var details = exception is BusinessException businessException
        ? businessException.Details
        : string.Empty;
        
        await context.Response.WriteAsync($"<html lang=\"{CultureInfo.CurrentCulture.Name}\"><body>\r\n");
        await context.Response.WriteAsync($"<h 3>{message}</h3>{details}<br>\r\n");
        await context.Response.WriteAsync("</body></html>\r\n");
        
        // Note the 500 spaces are to work around an IE 'feature'
        await context.Response.WriteAsync(new string(' ', 500));
    };
});

It will be available in 6.0. but you can change it by yourself now.

We have overwritten the modified code in the module file. It changes tenant information on the cookie but redirects to "tenant not found" exception page. It should redirect to main login page without any errors.

hi

Please custom the MultiTenancyMiddlewareErrorPageBuilder of AbpAspNetCoreMultiTenancyOptions to delete the cookies.

https://github.com/abpframework/abp/pull/13157

Hello, will this development be in the next first version?

Purging cache after deletion a tenant was shipped in v5.2.1.

Hi, I am using abp version 5.2.2 and the error still persists. I am writing steps how to reproduce the error.

  • A tenant named Test is created by entering the host in a browser.
  • The application is entered with the created tenant.
  • Then the application is exited and the login screen is displayed.
  • Login as host from a different browser and delete the Test tenant just created.
  • When we refresh the page we just logged out of, "Tenant not found! There is no tenant with the tenant id or name: 1e46a5e6-4fd1-ee24-a5c5-3a04ac356348".
  • As a workaround, you need to clear the browser's cache. The real solution to this needs to be done.

Can it be fixed with the first update?

Solution has been merged and will be shipped in v5.2.1 very soon

thanks, is there this improvement in current version 5.2.1? I'm asking because I can't see it in the changelog

Hello,

If you can download the source code, you can implement your fix until you upgrade your packages.

In organization-units.component.ts, after deleting a unit, you need to check if it is the selected unit.

Change

// ... 
.subscribe((status: Confirmation.Status) => { 
        if (status === Confirmation.Status.confirm) { 
          this.service.delete(id).subscribe(() => this.get()); 

to

// ... 
.subscribe((status: Confirmation.Status) => { 
        if (status === Confirmation.Status.confirm) { 
          this.service 
            .delete(id) 
            .pipe( 
              tap(_ => { 
                if (id === this.selectedUnit?.id) { 
                  this.selectedUnit = null; 
                } 
              }), 
            ) 
            .subscribe(() => this.get()); 
        } 
      }); 
 

thanks for the reply

It would be better to write information for those who have this problem under abp 5.0 version. Because after the statement that we will solve the problem, there was no information.

Showing 1 to 9 of 9 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11