Skip to content

fix(coderd): don't hang on first gitauth clone #7331

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

Merged
merged 1 commit into from
May 1, 2023
Merged

Conversation

ammario
Copy link
Member

@ammario ammario commented May 1, 2023

Previously, the coder git ssh command would hang on the API, which was endlessly polling the database for oauth tokens that expire in the future.

Some oAuth implementations (including GitHub by default) will not give back a token expiry date, and the absence of a token expiry date became the zero date in the database.

Follow-up calls to git clone would succeed because the non-polling path doesn't check expiry, perhaps by mistake.

In addition to fixing the zero date issue, this PR removes the PubSub which added too much complexity when the polling interval is 1 second.

@ammario ammario requested a review from kylecarbs May 1, 2023 02:19
@ammario ammario linked an issue May 1, 2023 that may be closed by this pull request
Previously, the `coder git ssh` command would hang on the API, which was endlessly
polling the database for oauth tokens that expire in the future.

Some oAuth implementations (including GitHub by default) will not give back a
token expiry date, and the absence of a token expiry date became the zero
date in the database.

Follow-up calls to `git clone` would succeed because the non-listen path doesn't
check expiry, perhaps by mistake.

In addition to fixing the zero date issue, this PR removes the PubSub
which added too much complexity when the polling interval is 1 second.
@ammario ammario merged commit 4b9621f into main May 1, 2023
@ammario ammario deleted the gitauth-first branch May 1, 2023 19:19
@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2023
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.

git auth: does not show Open the following URL the first time
2 participants