Skip to content

Keep Station operator polling authenticated during renewal - #50

Merged
scottconverse merged 1 commit into
mainfrom
windows/stop-renewal-race
Nov 24, 2026
Merged

scottconverse merged 1 commit into
mainfrom
windows/stop-renewal-race

Conversation

@scottconverse

Copy link
Copy Markdown
Contributor

Changes

  • Extend the existing opaque Station operator session during renewal so authenticated polls remain valid while the renewal response is in flight.
  • Synchronize session and ticket state. An in-flight renewal cannot restore a logged-out session, and each renewal still checks current Townlight staff authority.

Verification

  • Reproduced HTTP 401 against the previous implementation by delaying the renewal response and polling before the browser received its replacement cookie.
  • All 32 Station Windows contract tests passed locally, including overlapping renewals and logout during renewal.
  • In an isolated R9 candidate, four browser polls returned HTTP 200 during an intentionally held renewal response. After reconnecting to the same physical C922 recording, the browser Stop control returned HTTP 202 and Station finalized with operator-stop.

The earlier long-run Stop timeout lacked sufficient browser telemetry to establish its cause.

static = Path(__file__).with_name('ui')

def operator_cookie(response, token, request):
response.set_cookie('station_operator', token, httponly=True, secure=request.url.scheme == 'https',
@scottconverse
scottconverse merged commit f1b946b into main Nov 24, 2026
3 checks passed
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.

2 participants