Skip to content

Journeys: don't count the browser's authorize request as a callback call (sc-9611) - #299

Open
ndbroadbent wants to merge 2 commits into
mainfrom
journeys-callback-count
Open

ndbroadbent wants to merge 2 commits into
mainfrom
journeys-callback-count

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

A flaky journey failed #295, which changes only docs (run 47531375940):

FAIL sign-in-redirects-at-once-and-lists-after: the sign-in callback made 4 GitHub calls: GET /login/oauth/authorize, POST /login/oauth/access_token, GET /user, GET /user/emails

The journey counted the GitHub stub's calls whose times fell between asked and answered, the moments the test saw the browser's request to the callback and its response. Two things make that window unreliable:

  • Both clocks count whole milliseconds, so the browser's own GET /login/oauth/authorize can share a millisecond with asked. That is the call that redirects to the callback, and it got counted.
  • Playwright's events reach the test process late, so asked can come after the callback's first call (access_token). That call would then be left out, and one extra call could pass unnoticed.

The count now goes by order: the stub's calls after the last authorize request that finished before the callback answered. The limit of 3 calls (access_token, /user, /user/emails) and the 1500 ms check stay as they were.

The independent review found that the first version's exact-path match changed nothing. loco percent-encodes redirect_uri, so the old match never caught the authorize URL. I've removed it.

The log's server errors section was empty. No screenshots change. Part of sc-9611.

…wser's own authorize request (sc-9611)

Run 47531375940 failed a docs-only PR: GET /login/oauth/authorize, which the browser makes just before the callback,
fell inside the callback's time window on a busy runner and counted as a fourth call. The callback is also matched by
its path, not by any URL containing it.
…ize request, not by a window from the browser's timestamp (sc-9611)

This branch has not been deployed

No deployments
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.

1 participant