github / github/gh-gei

Add retry logic to `GithubApi.GetUserId`

Open
#687 0 comments 0 reactions 0 assignees View on GitHub
task tech debt
Dominant language
C#
Stars
478
Forks
146
Avg merge
7d 21h
Merged PRs (30d)
2

Description

When we implemented #668 we chose to not include `GetUserId` because the logic was a bit trickier in that specific scenario. This issue is to make sure we don't forget about it.

`GetUserId` is trickier because the way it was implemented, if it encounters an error it assumes that the username doesn't exist and returns null. And the calling code handles the null return case specifically, sometimes choosing to ignore the missing user and continuing, and sometimes choosing to error out.

When we add retries we will need to differentiate between an error such as `Service Unavailable` and `Login not found`. We should retry on basically all errors except the user not found, in that case we should return null.

We might also want to consider making the behavior in GithubApi consistent with the other functions and either returning the UserId value or throwing an exception. Then dealing with the exception and inspecting the error message in the calling code.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.