Skip to content

Grdowns/update channel4 - #2576

Merged
Bob Brown (bobbrow) merged 9 commits into
masterfrom
grdowns/update-channel4
Oct 2, 2018
Merged

Bob Brown (bobbrow) merged 9 commits into
masterfrom
grdowns/update-channel4

Conversation

@grdowns

Copy link
Copy Markdown
Contributor

Remove redundant telemetry on failure
Check GitHub API rate limit prior to attempting to download release
Update error message for failing to parse release JSON into type Build[]

Comment thread Extension/src/githubAPI.ts Outdated
}

function isRateLimit(input: any): input is RateLimit {
return input && input.rate && isRate(input.rate);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: checking input.rate here should be unnecessary (isRate will do it)

Comment thread Extension/src/githubAPI.ts Outdated
}

function isRate(input: any): input is Rate {
return input && input.remaining && typeof(input.remaining) === 'number';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think Sean added a util.isNumber function.

Comment thread Extension/src/githubAPI.ts Resolved
Comment thread Extension/src/githubAPI.ts Outdated

async function rateLimitExceeded(): Promise<boolean> {
const rateLimit: RateLimit = await getRateLimit();
if (rateLimit.rate.remaining <= 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is an async function using await. You should be able to just return rateLimit.rate.remaining here.

Comment thread Extension/src/githubAPI.ts Outdated
}

async function getRateLimit(): Promise<RateLimit> {
const header: OutgoingHttpHeaders = { 'User-Agent': 'vscode-cpptools' };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it looks like this is double-indented

Comment thread Extension/src/common.ts Resolved
@bobbrow

Copy link
Copy Markdown
Contributor

TSlint: tmp is no longer needed in the githubApi.ts import list

@bobbrow
Bob Brown (bobbrow) merged commit 80716ae into master Oct 2, 2018
@bobbrow
Bob Brown (bobbrow) deleted the grdowns/update-channel4 branch October 2, 2018 17:13
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants