Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: UI constructs excessively long URLs #3820

Closed
tillprochaska opened this issue Aug 1, 2024 · 0 comments
Closed

BUG: UI constructs excessively long URLs #3820

tillprochaska opened this issue Aug 1, 2024 · 0 comments
Labels
bug Things that should work, but don’t Moderate Issue that may require attention ui Issues related to Aleph’s frontend

Comments

@tillprochaska
Copy link
Contributor

tillprochaska commented Aug 1, 2024

Describe the bug
The auto-suggest input in the collection access control dialog uses the /roles/_suggest API. To not suggest users that already have access to the collection, the UI passes the IDs of all users and groups that already have access as a query parameter:

Given a collection that is already shared with users 1, 2, and 3, the API URL would look something like this:

/roles/_suggest?prefix=jane.doe&exclude:id=1&exclude_id=2&exclude:id=3

To Reproduce
Steps to reproduce the behavior:

  1. Create a large number of groups (250+) and add yourself to these groups. You can also temporarily reduce the Gunicorn request line limit and will experience the issue with a lower number of groups.
  2. Navigate to a collection and open the sharing settings from the settings dropdown.
  3. Click on "Choose a user" and start typing"
  4. Observe the API requests the UI sends in the browser developer tools network tab. You should see requests to /api/2/roles/_suggest with one exclude:id query parameter for every group your user is part of. If the total length of the request URI exceeds the Gunicorn limits, the request will fail.

Expected behavior
The auto-suggest input should work even for users that are members of many groups.

Aleph version
3.15.7, 3.4.0-rc*

Screenshots
image

Additional context

  • This error occurs as long as a user is a member of many groups, no matter whether a collection is actually shared with many/all of them.
  • This error would also occur when sharing an investigation with a large number of users, but this a) is something that users have to do explicitly, and b) I don’t think this was ever an issue before.
  • Need to double check, but I think /roles/_suggest will only ever return users and never groups, so it isn’t necessary to explicitly exclude group IDs.
@tillprochaska tillprochaska added bug Things that should work, but don’t ui Issues related to Aleph’s frontend Moderate Issue that may require attention labels Aug 1, 2024
tillprochaska added a commit that referenced this issue Aug 1, 2024
The reason behind excluding specific IDs is to not suggest users and groups that are already associated with the collection. However, the `/roles/_suggest` endpoint returns only users, never groups, so there is no point in explicitly excluding groups. Fixes #3820.

In case a collection is shared with a large (200+) number of individual users, this may cause the same error as reported in #3820. However, this would require explicitly sharing a collection with such a large number of users whereas #3820 affected any collection, even if it wasn’t shared with anyone. Also, I don’t think there has been a use case for sharing a collection with so many individual users, and probably using groups would be more appropriate in such a situation.
stchris pushed a commit that referenced this issue Aug 1, 2024
The reason behind excluding specific IDs is to not suggest users and groups that are already associated with the collection. However, the `/roles/_suggest` endpoint returns only users, never groups, so there is no point in explicitly excluding groups. Fixes #3820.

In case a collection is shared with a large (200+) number of individual users, this may cause the same error as reported in #3820. However, this would require explicitly sharing a collection with such a large number of users whereas #3820 affected any collection, even if it wasn’t shared with anyone. Also, I don’t think there has been a use case for sharing a collection with so many individual users, and probably using groups would be more appropriate in such a situation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that should work, but don’t Moderate Issue that may require attention ui Issues related to Aleph’s frontend
Projects
None yet
Development

No branches or pull requests

1 participant