Skip to content
New issue

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

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

Already on GitHub? # to your account

Add user data #127

Merged
merged 14 commits into from
Apr 29, 2024
Merged

Add user data #127

merged 14 commits into from
Apr 29, 2024

Conversation

Aidasvenc
Copy link
Collaborator

@Aidasvenc Aidasvenc commented Apr 27, 2024

What I did

This is a big one. It covers finalizing a complete User registration flow and storing/fetching all User data to/from Firestore Database.

  • Redefined database fetching/registration functions to be non-blocking. All error codes now have a mapping to user-friendly error messages.
  • Instead of an alert, a Toast message is now displayed. This helps the flow to be less blocking (no need to dismiss an alert).
  • All information filled out during the registration phase is now saved using Context and passed during the creation of a user model in the database.
  • Real user data is now displayed in the profile screen.
  • Each database model will now have its' global type that will be defined in types folder.

One detail that we will need to address during our meeting is how to refine the Google Sign-in registration flow. Currently, if a user does a first time sign-in, its' user object in the database cannot be filled in with user information because it has never been filled in. Therefore, in this case we should do one of the two:

  • redirect such a user to Information and then Interests so that he would be forced to fill in initial information.
    or
  • redirect such a user to UpdateMyProfile where he would be forced to fill in initial information.

both of these ways would require to define some prop for a screen which would indicate whether a user is coming from the google # or not (because the layout would be different, the user in that case should not be able to go back, should not be able to quit and should not be re-directed to Authentication after Interests). Therefore, we need to define a flow and a mockup in Figma to illustrate how it needs to be implemented.

How I did it

  • Used firestore querying functions
  • Added a new package for Toast messages

How to verify it

Try out the registration flow yourself

Demo video

WhatsApp.Video.2024-04-27.at.21.42.38_431ead85.mp4

image

Pre-merge checklist

The changes I have introduced:

  • work correctly
  • do not break other functionalities
  • work correctly on Android
  • are fully tested

Copy link

sonarqubecloud bot commented Apr 28, 2024

@Aidasvenc Aidasvenc requested a review from gaspardthrl April 28, 2024 21:31
Copy link
Collaborator

@gaspardthrl gaspardthrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I told you by message, I really like the work you did! I was not sure about types vs classes at first but you explained clearly why it made more sense to use types for users. I don't have anything to say except that your code looks good to me!

Copy link
Collaborator

@GaelCondeLosada GaelCondeLosada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work ! I didn't have time to check all files in detail but I tested it on android and everything works correctly (I checked the android box). Looks good to me !

@GaelCondeLosada
Copy link
Collaborator

Don't forget to address/acknowledge sonar cloud issues before merging.

@Aidasvenc Aidasvenc merged commit 442203c into main Apr 29, 2024
3 checks passed
@Fyuryy Fyuryy mentioned this pull request May 14, 2024
4 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants