Skip to content

Verify OAuth refresh coordination across repeated concurrent request waves #526

Description

@zackbart

Motivation

Connecta already coordinates rotating-token refreshes across request scopes and tests two-request contention, cancellation, and credential-write races. Add regression coverage under greater contention and prove the coordinator handles another refresh after the first settles.

Duplicate redemption can invalidate a rotating refresh token or its token family. A single successful wave cannot establish that the gate releases correctly rather than retaining a settled result or blocking later calls.

Inspired by Executor's cross-session refresh tests: UsefulSoftwareCo/executor#1537.

Behavioral requirements

Exercise one OAuth connector and credential partition in one runtime through two successive waves of eight independent request scopes. Each wave must force overlapping refresh demand rather than rely on incidental scheduler timing. The second wave must require another refresh using credentials saved by the first.

Preserve Connecta's existing request lifetimes and cancellation semantics. This issue requests regression coverage, not detached refresh work, cross-isolate coordination, or an OAuth architecture change.

Acceptance criteria

  • Eight overlapping callers cause exactly one token-endpoint refresh grant in the first wave, and all complete successfully with the newly issued access token.
  • After the first wave settles, eight overlapping callers trigger exactly one additional grant using the rotated refresh token. All complete successfully with the second access token.
  • Upstream request records establish both grant counts and token usage, including that no retired refresh token is redeemed again.
  • The scenario fails on duplicate redemption, reuse of a settled first-wave result, or a gate that never releases. Concurrency is deterministic and waits are bounded without arbitrary sleeps.
  • Coverage runs in the applicable Node and Workers test projects. Any new suite is classified and documented under repository conventions.
  • npm run check passes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions