pierrejeambrun opened a new pull request, #73176:
URL: https://github.com/apache/airflow/pull/73176
### Problem
The UI aborts any request to a URL that previously returned `403
{"detail":"Forbidden"}`, and it kept that block for the **entire page load**
(`main.tsx`, a module-level `Set` that is only ever added to). The rationale
was "permissions won't change mid-session."
That assumption breaks whenever the auth token is refreshed or rotated
mid-session — e.g. an auth manager that re-issues the token out of band. A
momentarily stale/half-refreshed token makes a batch of requests (a dashboard's
polling fan-out) come back `403 Forbidden`; the UI then permanently blocks all
those URLs client-side. Even once the token recovers, the endpoints stay dark
until the user does a full browser refresh (which wipes the in-memory `Set`).
That's the reported symptom: a dashboard fills with forbidden errors after a
while, and only a manual refresh clears it.
### Fix
Move the block bookkeeping into `src/utils/forbiddenUrls.ts` and bound it: a
URL is blocked for a short window and then allowed to retry, so a recovered
endpoint heals on its own instead of staying blocked for the session. A
genuinely-forbidden endpoint simply 403s again on retry and is re-blocked, so
the anti-polling-spam intent of the original change is preserved (it just polls
at most once per window instead of never).
### Testing
`src/utils/forbiddenUrls.test.ts` covers: a recorded URL is blocked; an
unrecorded/undefined URL is not; the block lifts once the window elapses
(recovery); and a URL that 403s again on retry is re-blocked.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 4.8)
Generated-by: Claude Code (Opus 4.8) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]