Repository navigation
Conversation
shiftkey
commented
Feb 25, 2019
| public async _loadAndCacheUser( | ||
| accounts: ReadonlyArray<Account>, | ||
| repository: Repository, | ||
| sha: string | null, |
Member
Author
There was a problem hiding this comment.
We can drop the | null here because there's no longer any caller that is passing in null, so we can simplify the code paths in findUserWithAPI.
shiftkey
marked this pull request as ready for review
February 25, 2019 20:46
Member
Author
|
Closing this out in favour of a more targeted fix now I have uncovered the root cause: #6313 (comment) |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adding some resiliency and tracing to
GitHubUserStore._loadAndCacheUserbecause I don't entirely trust what it's trying to cache.Related to #6313 but I don't quite follow how it would result in a disabled app menu
Description
Keep in mind the original issue that the app is calling this function and one of these fields is
undefined:desktop/app/src/lib/stores/github-user-store.ts
Lines 512 to 518 in c00061f
The stack trace from #6313 mentions these three functions (albeit minified to strip the function names):
GitHubUserStore._loadAndCacheUser->GitHubUserStore.cacheUser->userWithLowerCase.And
cacheUseris invoked only when it finds a valid object forgitUser:desktop/app/src/lib/stores/github-user-store.ts
Lines 233 to 238 in c00061f
So what is
_loadAndCacheUserdoing that might be risky?My working theory here is that one of these operations is returning a user with an empty
login, which is triggering the action. The app can work fine without finding an user here, so this PR changes the behaviour of this area to:gitUserthat's an invalid state, with details to help us isolate the issue if it gets reportedgitUser, it clears the variable so the app doesn't try and cache itArmed with more details about this issue from someone who has encountered #6313, we can make this area more reliable once we know what piece of data we're missing...
Release notes
Notes: