Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: remove duplicate validate calls on same oauth token#11598

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 3 commits intomainfromstevenmasley/validate_debounce
Jan 12, 2024

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedJan 12, 2024
edited
Loading

What this does

If we have an invalid token in the db, we should not spam github with the same validate call over and over.

I am not sure how often this was hit in production, since most keys that go invalid expire, which we already check for.

This happens if someone manually revokes a token.

Related to#10853

Thoughts

I think this should really be solved more generally. We should remember when a token is invalid, and not try again. The browser and other things also trigger this call, which we could deduplicate with a cache.

This would save some calls in all cases.

The metrics indicate we are potentially sending more calls from TokenSource thenValidate though.

@EmyrkEmyrk requested a review fromjohnstcnJanuary 12, 2024 20:07
Comment on lines +214 to +219
ifoptions.NewTicker==nil {
options.NewTicker=func(duration time.Duration) (tick<-chan time.Time,donefunc()) {
ticker:=time.NewTicker(duration)
returnticker.C,ticker.Stop
}
}
Copy link
Member

Choose a reason for hiding this comment

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

This is OK for now but we should probably swap this out for something better later on 🕰️

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I agree. Some fake clock solution would be ideal, then we can use across all tests more generally.

@EmyrkEmyrk merged commit03ee639 intomainJan 12, 2024
@EmyrkEmyrk deleted the stevenmasley/validate_debounce branchJanuary 12, 2024 20:27
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 12, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@EmyrkEmyrk

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Emyrk@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp