Fix GitHub account ids being numbers (#228045)

For a long time the account id wasn't handled correctly. It should be a string, but the API returns a number. This ensures it's a string and does some migration logic.
This commit is contained in:
Tyler James Leonhardt
2024-09-09 19:39:37 -07:00
committed by GitHub
parent d8af24e15d
commit c4d1cc2e67
2 changed files with 23 additions and 6 deletions

View File

@@ -228,9 +228,9 @@ export class GitHubServer implements IGitHubServer {
if (result.ok) {
try {
const json = await result.json();
const json = await result.json() as { id: number; login: string };
this._logger.info('Got account info!');
return { id: json.id, accountName: json.login };
return { id: `${json.id}`, accountName: json.login };
} catch (e) {
this._logger.error(`Unexpected error parsing response from GitHub: ${e.message ?? e}`);
throw e;