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

Use LiteUser in lots of places in the frontend #4936

Open
aapeliv opened this issue Oct 1, 2024 · 1 comment · May be fixed by #4951
Open

Use LiteUser in lots of places in the frontend #4936

aapeliv opened this issue Oct 1, 2024 · 1 comment · May be fixed by #4951
Assignees

Comments

@aapeliv
Copy link
Member

aapeliv commented Oct 1, 2024

The frontend currently loads the user's whole profile in most cases, even if all it needs is the name + avatar. We discussed this at a few dev meetings, and for now I've implemented a GetLiteUser RPC that returns just the minimal info needed in the majority of cases in the backend. The main places where this does NOT work are the profile itself, and the map (that's a separate exercise).

In addition to the lite user RPC, there is also the GetLiteUsers RPC that gets many users: this allows fetching up to 200 users at a time in one backend call, which should significantly reduce the number of calls required e.g. when opening the map page.

This issue requires:

  1. Creating a parallel useLiteUser(s) hook similat to the existing useUser(s) hook, and
  2. Updating many uses of the latter hook to the new former hook.

rpc GetLiteUser(GetLiteUserReq) returns (LiteUser) {
// Get minimal info about a particular user
}
rpc GetLiteUsers(GetLiteUsersReq) returns (GetLiteUsersRes) {
// Get minimal info about a bunch of users
}

@aapeliv
Copy link
Member Author

aapeliv commented Oct 15, 2024

@nabramow : the getLiteUsers API call is in this ticket.

Related to #4951

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants