Skip to content

Conversation

@alex-mechler
Copy link
Contributor

@tgolen can you review please?

The only reason I could find that logins were stacking up is somehow being signed out without hitting the signOut method in Session. When this would happen, we would create a new login on signing in without first deleting the old login. This adds a check that will delete our existing login if credentials.login exists when creating a new login.

Fixed Issues

Fixes https://github.com/Expensify/Expensify/issues/141184

Tests

  1. Clear all react-native-chat secondary devices / logins from your test account
  2. Sign into chat
  3. On e.com, in the settings, verify you only have 1 react-native-chat assosicated login
    image
  4. In local storage, delete the session key. This will sign you out without hitting the signOut flow
    image
  5. Verify you still have a react-native-chat login in e.com
  6. Sign back into chat
  7. Verify you still have only 1 react-native-chat login, and that it has changed
    Uploading image.png…

Screenshots

N/A

@alex-mechler alex-mechler requested a review from tgolen October 6, 2020 21:49
@alex-mechler alex-mechler self-assigned this Oct 6, 2020
src/lib/API.js Outdated

if (credentials && credentials.login) {
// If we have an old login for some reason, we should delete it before storing the new details
// eslint-disable-next-line no-use-before-define
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you just move the position of deleteLogin() instead? I think it looks OK to do so from looking at the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yup, this was leftover from when I was doing some crazy different logic to make it work. Reorganized

@alex-mechler
Copy link
Contributor Author

Updated

@tgolen tgolen merged commit ab74244 into master Oct 7, 2020
@tgolen tgolen deleted the amechler-delete-login-before-new-signing branch October 7, 2020 15:32
@MelvinBot MelvinBot mentioned this pull request Jan 29, 2024
50 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants