Golf-Drill-Challenge-App/Golf-App

Error "Reduce" when signing out

Closed this issue · 4 comments

Description

When testing functionality around removing a user, I found when I would use the sign out button, I would receive the error in the attached Screenshot

Steps to reproduce

  1. Create a new user (Updated)
  2. Navigate to the profile page
  3. Click the settings icon
  4. Press the sign out button

Screenshot

image

Jake's explanation of triggering the error (more details):

  • open app on two devices, one of them logged in as coach, one as player
  • coach removes the player
  • player automatically logs in again (from login persistence in context/Auth.js) and gets error shown (profile page > settings)
    • unclear what happens if logged out user tries to log in normally (type in username and password)

possible solutions:

  • some sort of try catch on profile page to log out undefined user?
  • check in context/Auth.js to log out user that is undefined (try to directly modify the auto-login feature / persistent login)
  • probably have to check caching logic for useUserInfo hook

Not sure if this is still happening as I was able to sign out without getting this error message but instead recieved a " ERROR [TypeError: Cannot read property 'uid' of null]" error... Will try to include more information as I am testing #190 and signing out of accounts frequently

was able to reproduce this error actually upon testing.

  • Create a new user.
  • Go to profile tab
  • click settings icon
  • Click signout

Should be fixed by PR linked above, closing as completed