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

Update server UserConfig document from client set profile picture/display name #291

Open
h1divp opened this issue Sep 18, 2024 · 2 comments
Assignees
Labels
Backend📡 Issues corresponding to the backend/API. Feature New feature or request Frontend 🖥 Issues corresponding to the frontend/client. Medium You should have some familiarity with our codebase to work on this issue

Comments

@h1divp
Copy link
Collaborator

h1divp commented Sep 18, 2024

For #254.

Summary

Currently, the user is able to set their profile picture (a numbered image, and color hex code), and their display name (string) through the Settings Screen.

We need to make sure that, once these settings change, a user's UserConfig document gets updated in Firebase through a fetch call to our backend web API. We also need a way to make similar calls that retrieve UserConfig information, so that profile pictures and display names (among other things) can be retrieved for every message. To do this we need to:

  1. Create two web API endpoints in the backend that update the displayName and userIcon values for the UserConfig firebase document defined in the UserConfig type. The web API lives in /server/src/routes and the endpoints should be created in /server/src/routes/user. Needed error checking code should also be implemented, following the style of the other files in this directory. Note that this Firebase document gets created in a call made in the frontend after the user signs up.
  2. A "Fetch Context" should be created in the frontend, following the style of the Socket Context. The purpose of this file will be to make any needed fetch requests to our backend web API, rather than hardcoding them inside of other files. We currently make all of our backend requests via the Socket Context, which updates too quickly for the purpose of the simple value changes we need.
  3. After UserConfig settings are updated in the Settings Page, use this new context to send the requests to the backend so that the database can be updated upon updates made to display name and profile picture state.

After making these changes, create a PR and mention the Issue Number for this issue (so that it can close automatically after a merge).
Comment below to be assigned.

Dependent issues

  • Retrieve non-client profile picture/display name info when a message is received and render in chat screen
@h1divp h1divp added Feature New feature or request Backend📡 Issues corresponding to the backend/API. Frontend 🖥 Issues corresponding to the frontend/client. Medium You should have some familiarity with our codebase to work on this issue labels Sep 18, 2024
@h1divp
Copy link
Collaborator Author

h1divp commented Sep 18, 2024

One more small thing: The UserConfig type in the backend currently needs a bit of updating. The document attributes should match what's used when the document is created in the frontend. This needs to be put into its own type file in the frontend too but hasn't yet. Apologies for any confusion.

@eris6
Copy link
Contributor

eris6 commented Sep 18, 2024

i can try this !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend📡 Issues corresponding to the backend/API. Feature New feature or request Frontend 🖥 Issues corresponding to the frontend/client. Medium You should have some familiarity with our codebase to work on this issue
Projects
None yet
Development

No branches or pull requests

2 participants