Skip to content

UserService.GetAllInGroup fails when there are a lot of users in the group #18420

@LennardF1989

Description

@LennardF1989

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

13.6.0

Bug summary

Whenever a group reaches a certain amount of users associated, the UserService.GetAllInGroup will fail with the following message:

The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.

Specifically, it will fail in the UserRepository > PerformGetReferencesDtos:

        // get users2groups

        Sql<ISqlContext> sql = SqlContext.Sql()
            .Select<User2UserGroupDto>()
            .From<User2UserGroupDto>()
            .WhereIn<User2UserGroupDto>(x => x.UserId, userIds);

        List<User2UserGroupDto>? user2Groups = Database.Fetch<User2UserGroupDto>(sql);

Potentially fix is either batching this, or not using a prepared statement and instead write a raw query.

Specifics

No response

Steps to reproduce

Have a lot of users assigned to a single group.

Expected result / actual result

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions