Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor SetAndCheckGitHubToken method and handle rate limit throttling #125

Merged
merged 10 commits into from
Aug 4, 2021

Conversation

ryfu-msft
Copy link
Contributor

@ryfu-msft ryfu-msft commented Jul 23, 2021

This PR fixes #116.

Changes:
The SetAndCheckGitHubToken method aimed to handle too much like reading from cache, checking access, storing and deleting cache token, and initiating oauth login.

Because of this, I decided to refactor the method into smaller ones so that the smaller components can be easier to utilize. This includes checking the cache for a stored token to help prevent rate limit throttling when using the update command without providing a token.

Microsoft Reviewers: Open in CodeFlow

@ryfu-msft ryfu-msft requested a review from palenshus July 23, 2021 23:46
@ryfu-msft ryfu-msft requested a review from a team as a code owner July 23, 2021 23:46
@ghost ghost added the Issue-Bug label Jul 23, 2021
@ryfu-msft ryfu-msft requested review from palenshus and removed request for palenshus July 24, 2021 00:11
@palenshus
Copy link
Contributor

palenshus commented Jul 26, 2021

// Copyright (c) Microsoft. All rights reserved.

Revert this file, only whitespace changed


In reply to: 887075907


In reply to: 887075907


In reply to: 887075907


In reply to: 887075907


Refers to: src/WingetCreateCore/Common/GitHub.cs:1 in 58bf882. [](commit_id = 58bf882, deletion_comment = False)

Copy link
Contributor

@palenshus palenshus left a comment

Choose a reason for hiding this comment

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

🕐

@ghost ghost removed the Needs-Author-Feedback label Aug 3, 2021
@ryfu-msft
Copy link
Contributor Author

// Copyright (c) Microsoft. All rights reserved.

Reverted this file.


In reply to: 887075907


Refers to: src/WingetCreateCore/Common/GitHub.cs:1 in 58bf882. [](commit_id = 58bf882, deletion_comment = False)

@ryfu-msft ryfu-msft merged commit de32cc8 into main Aug 4, 2021
@ryfu-msft ryfu-msft deleted the refactorOauth branch August 4, 2021 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cached Github token not being used for non-submission API calls, leading to rate limits
3 participants