Skip to content

Fix crash in welcome flow when signing in to an endpoint that has an existing account#19442

Merged
sergiou87 merged 2 commits intodevelopmentfrom
fix-existing-account-crash
Oct 23, 2024
Merged

Fix crash in welcome flow when signing in to an endpoint that has an existing account#19442
sergiou87 merged 2 commits intodevelopmentfrom
fix-existing-account-crash

Conversation

@niik
Copy link
Member

@niik niik commented Oct 23, 2024

Description

Fixing a bug introduced in #19342 that can cause a crash in the welcome flow due to inadequate handling of the ExistingAccountWarning state in the welcome flow.

Ways to reproduce:

  1. Launch the app in welcome flow (i.e fresh install)
  2. Sign in to GitHub.com
  3. Hit cancel when asked to fill in gitconfig and return to sign in page
  4. Sign in to GitHub Enterprise but enter github.com as the endpoint
  5. See the existing account warning and click open in browser
  6. 💥

..or...

  1. Welcome flow
  2. Sign in to dotcom
  3. Hit cancel on gitconfig page
  4. Sign in to dotcom again
  5. 💥

I chose to address this in the sign in store rather than the Welcome flow so that any other callsites we might have in the future can benefit. I also considered simply ignoring the ExistingAccountWarning in the sign in store, but noticed that by doing so it could theoretically be possible to use the welcome flow to sign in to more than 2 (GH.com + GHE) accounts which I have no clue how the app would deal with.

Screenshots

Release notes

Notes: [Fixed] App no longer crash for first time users going through the welcome flow and attempting to sign in more than once.

@niik niik requested a review from sergiou87 October 23, 2024 14:07
@niik niik marked this pull request as ready for review October 23, 2024 14:07
Copy link
Member

@sergiou87 sergiou87 left a comment

Choose a reason for hiding this comment

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

Code LGTM, tested it and worked as expected 👏

@sergiou87 sergiou87 merged commit 5a70042 into development Oct 23, 2024
@sergiou87 sergiou87 deleted the fix-existing-account-crash branch October 23, 2024 14:23
sergiou87 added a commit that referenced this pull request Oct 23, 2024
Fix crash in welcome flow when signing in to an endpoint that has an existing account
@sergiou87 sergiou87 mentioned this pull request Oct 23, 2024
3 tasks
@HuuTrungLa
Copy link

gh pr checkout 19442

@HuuTrungLa

This comment was marked as spam.

@desktop desktop deleted a comment from hadirahmani4326 Nov 26, 2024
@Zavalynech
Copy link

G

@Zavalynech
Copy link

#19442

@Zavalynech
Copy link

[!NOTE]

Copy link

@Zavalynech Zavalynech left a comment

Choose a reason for hiding this comment

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

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.

4 participants