Starts in:
2 DAYS
9 HRS
31 MIN
50 SEC
Starts in:
2 D
9 H
31 M
50 S

Activities of "enes.koroglu"

Hi @maliming

Your code (Pull Request) works on Abp 7.2, our project is Abp 5.3.3 so we had to change some codes. I changed IdentityUserRepository variable's type from IIdentityUserRepository to IRepository<IdentityUser>. And did a second change on using IdentityUserRepository like below:

//var users = await IdentityUserRepository.GetListByIdsAsync(userGroup.Select(x => x.TargetUserId));
//changed above code like below
var users = (await IdentityUserRepository.GetQueryableAsync())
          .Where(p => userGroup.Select(p => p.TargetUserId).Contains(p.Id)).ToList();

In this scenario operation time gets to 15 seconds from 30 seconds.

We made a performance improvement on your code like below and operation time is reduced to 10 seconds from 15 seconds with this change below (increased round trip on your code):

List<IdentityUser> allUsers = new(); //added
using (dataFilter.Disable()) //added
{
    allUsers = (await IdentityUserRepository.GetQueryableAsync()) //added
              .Where(p => allLinkUsers.Select(p => p.TargetUserId).Contains(p.Id)).ToList(); //added
} //added

foreach (var userGroup in allLinkUsers.GroupBy(x => x.TargetTenantId))
{
    var tenantId = userGroup.Key;

    TenantConfiguration tenant = null;
    if (tenantId.HasValue)
    {
        tenant = await TenantStore.FindAsync(tenantId.Value);
    }

    using (CurrentTenant.Change(tenantId))
    {
        //var users = await IdentityUserRepository.GetListByIdsAsync(userGroup.Select(x => x.TargetUserId)); //commented
        //changed above line like below line
        var users = allUsers.Where(p => userGroup.Select(p => p.TargetUserId).Contains(p.Id)).ToList(); //added

        foreach (var user in users)
        {
            userDto.Add(new LinkUserDto
            {
                TargetUserId = user.Id,
                TargetUserName = user.UserName,
                TargetTenantId = tenant?.Id,
                TargetTenantName = tenant?.Name,
                DirectlyLinked = userGroup.FirstOrDefault(x => x.TargetUserId == user.Id)?.DirectlyLinked ?? false
            });
        }
    }
}

Note We reduced operation time to 10 seconds and nearly all the time is used by below code line. We inspected source of IdentityLinkUserManager.GetListAsync() method from github and this method makes too much round trips:

var linkUsers = await IdentityLinkUserManager.GetListAsync(new IdentityLinkUserInfo(currentUserId, currentTenantId), includeIndirect: true);

Sent via mail

Hi @maliming

Any news about this problem?

Hi @alper my database is on the cloud and services are working on-premises so if there is too much round trip that may cause too much latency. And for 900 records 4.5 second is not also a good time. Is it possible to change fetching all records to fetching only current page records. And also could you please check if there is a loop for user or tenant info fetch?

Hi @gizem

Did you able to test?

Hi @alper did you try on your environment? Which indices you have on AbpLinkUsers or any related table? And why getting all records on a paged page, shouldn't it fetch 10 records for paged page?

  • ABP Framework version: v5.3.3
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

We are creating a support account, under every tenant and we are linking these accounts each other. Now we have aproximately 50 tenant and when we open Linked Accounts modal, it takes 30 seconds. This is really slow, if the number exceeds user gets timeout (so we removed some records to be able to open Linkend Accounts screen). I realised this endpoints gets whole records, not only selected page's records and also 50 records is not too much to take 30 seconds. I think there is a problem.

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v5.3.3
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Steps to reproduce the issue:"

I have some entities like below:

public class Order :AggregateRoot<Guid>
{
    public string Name { get; set; }
    public string Address { get; set; }
    public ICollection<OrderLine> Lines { get; set; }
}
public class OrderLine:Entity<Guid>
{
    public Guid ProductId { get; set; }
    public Guid OrderId { get; set; }
    public int Quantity { get; set; }
    public Product Product { get;}
}
public class Product:AggregateRoot<Guid>
{
    public string Name { get; set; }
    public string Description { get; set; }
}

public class EfCoreOrderRepository : EfCoreRepository<CommonDbContext, Order, Guid>, IOrderRepository
{
    public async Task<Order> GetWithNavigationPropertiesAsync(Guid id)
    {
        var query = from order in (await GetDbSetAsync()).Include(p => p.Lines).ThenInclude(s => s.Product)
                    where order.Id == id
                    select order;
        return await query.SingleAsync();
    }
}

I've added Product as a navigation property to OrderLine entity. But as we see in docs there is a section which says:

Do always reference to other aggregate roots by Id. Never add navigation properties to other aggregate roots.

  1. What is the main reason of this suggestion, could you please give more detail?
  2. If our way is wrong, how should we get Order/Lines and Product details on GetWithNavigationPropertiesAsync method.
  • ABP Framework version: v5.3.3
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Steps to reproduce the issue:"
    • Create a role named as role-supervisor.
    • Give below grants (Picture 1) to role-supervisor.
    • Assign role-supervisor to a user (supervisor).

-Picture 1-

This user can grant admin role to any user, or revoke admin role from any user as you can see in Picture 2. I want to create a role which can create/edit/lock/unlock user, assign/deassign roles to/from user. But i do not want the owner of this role to assign/deassign admin (or marked as special or private other roles) some other roles from/to users. There may be a solution like a new property for role as private. Define a new permission under Identity Management permission section for grant/revoke private role. Should be a new permission for grant/rekove private roles to any user. And owner of role-supervisor should not act on some private/special users.

-Picture 2-

Hi @liangshiwei

In above message your suggestion (below code) does not solve our problem. If we got any error on backgroudjob creation, process will be broken. If it's a UI call, user will get an error and business will be completed. As @ademaygun said there is no UI dashboard to manage and see background jobs for ABP's BackgroundJob system and in the documents ABP suggest us hangfire as an integrated solution. But ABP does not work with Hangfire properly. There would be same problem in EventBus but luckly ABP solves that problem with implementing inbox pattern. There could be same solution for background jobs.

Is it possible to discuss this problem with the team? This problem is really critical for us.

public async Task CreateAsync()
{
    using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
    {
        //...
        await productRepository.InsertAsync(new Product("Product1"));
        await uow.CompleteAsync();
    }
            
    await backgroundJobManager.EnqueueAsync(ProductJobArgs);
}
Showing 11 to 20 of 45 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06