Nameless icon indicating copy to clipboard operation
Nameless copied to clipboard

ListUser end point does not return groups

Open SenPr opened this issue 2 years ago • 5 comments

Describe the issue

If you make a request /users to get a list of multiple users (not UserInfo) it will not return the player's group.

From what I can see in ListUsersEndPoint.php there is a query for groups, but no groups are returned.

This currently does not affect much, but using Java-API with this function causes NullPointerException when requesting anything related to groups.

NamelessMC Version

2.0.0

To Reproduce

No response

Expected Behaviour

No response

Screenshots

No response

Additional Information

No response

SenPr avatar Aug 25 '22 04:08 SenPr

The List Users endpoint does not have any query to list groups, the one query who is there is for filtering if you wanna find users who have that group etc

partydragen avatar Aug 25 '22 14:08 partydragen

The plugin expects the user list endpoint to return the same information as the user info endpoint, but for multiple users. Can the list users endpoint be changed so this is the case? It would keep the client side implementation simple and fast

Derkades avatar Aug 25 '22 19:08 Derkades

that still being quite resource heavy to add alot of queries per user + module support later to add even more info to user details

then userinfo endpoint even being pointless, can just be deleted as then user filter can just be used for the users like i have done with several of my endpoints for my modules

partydragen avatar Oct 06 '22 16:10 partydragen

It might seem resource heavy, but it is much more resource heavy for the plugin to make many UserInfo requests. Indeed, the UserInfo endpoint could be removed when ListUser has the same functionality

Derkades avatar Oct 07 '22 07:10 Derkades

Yes but what about the most cases where people just want the basic details and full user list, pagination always suck

who want to print out all 20k users at once with the basic user details then we want it fast and not load a huge amount of other heavy data

partydragen avatar Oct 07 '22 12:10 partydragen

Moved to 2.1.0 because the approach of adding an additional parameter is an API change

Derkades avatar Jan 17 '23 13:01 Derkades

Moved to 2.1.0 because the approach of adding an additional parameter is an API change

Yet is it a bug fix, Aswell this change is not a breaking change Bug fixes can always do changes to fix how its supposed to work with might also require parameter like this

partydragen avatar Jan 17 '23 16:01 partydragen

In my opinion, a new feature is a breaking change. Just a different kind; it turns into a breaking change for the client. If, for example, the namelesss plugin started using &groups, that means it would only work with 2.0.3 and not with 2.0.0-2.0.2. I believe the compatibility goal was that not only all modules and templates would work on any 2.0.x version, but the same for API clients like Nameless-Plugin and Nameless-Link.

It could be that I have misinterpreted this though, and the intention was to only have backwards compatibility. So, software released before the patch version will continue to work on the new patch version, but newly released software may not work on older patch releases. This is not a big issue, since updating is guaranteed to not result in breakage.

Derkades avatar Jan 17 '23 18:01 Derkades