Skip to content

Conversation

@babakks
Copy link
Member

@babakks babakks commented Jan 28, 2026

Fixes #108

I've pushed babakks/test-oauth-polling-2 to cli/cli to test the changes in this PR/branch.

This PR improves the device flow experience to accommodate for edge cases where the monotonic clock (which is the basis for time measurement) runs fast. See the linked issue and cli/cli#9370 for more context.

The summary of the changes are:

  • Use a primary safety extension of 20% to polling intervals.
  • Use a secondary extension of 40% after receiving the first slow_down and keep it even if we didn't get more slow_downs.
    - If there's a clock drift higher than 5% (abs):
    - If positive (faster mono), bail out at the 3rd slow_down.
    - If negative (slower mono), bail out at the 5th slow_down.
  • Updated: If received the 2nd slow_down bail out with an error message including the measured clock drift.

Signed-off-by: Babak K. Shandiz <babakks@github.com>
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Signed-off-by: Babak K. Shandiz <babakks@github.com>
@babakks babakks linked an issue Jan 28, 2026 that may be closed by this pull request
@babakks babakks requested a review from williammartin January 28, 2026 12:08
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Signed-off-by: Babak K. Shandiz <babakks@github.com>
@babakks babakks merged commit a390d0f into main Jan 28, 2026
35 checks passed
@babakks babakks deleted the babakks/account-for-fast-mono-clock branch January 28, 2026 13:49
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.

Enhance polling interval waits

2 participants