Skip to content

Conversation

@babakks
Copy link
Member

@babakks babakks commented Dec 11, 2025

Fixes #76

These changes handle the slow_down error in this way:

  • If no new interval is provided by the error response, it'll increase the current interval by 5 seconds as per the RFC spec.
  • If a new interval is provided, it'll use it. This is how GitHub OAuth API works (docs).

New tests also cover the rare case of multiple slow_down errors.

Note

I've also E2E tested the changes thanks to the sample code in device/examples_test.go.

@babakks babakks linked an issue Dec 11, 2025 that may be closed by this pull request
@babakks babakks requested a review from BagToad December 11, 2025 22:21
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Copy link
Member

@BagToad BagToad left a comment

Choose a reason for hiding this comment

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

LGTM, changes make sense as we discussed.

- uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v1
uses: actions/setup-go@v6
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for updating this ✨

@babakks babakks merged commit d28c578 into main Dec 18, 2025
34 checks passed
@babakks babakks deleted the babakks/handle-slow-down branch December 18, 2025 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Device code flow not respecting slow_down

2 participants