Skip to content

feat(seer): Support conditional requests on the autofix state endpoint - #121885

Merged
alexsohn1126 merged 8 commits into
masterfrom
alexsohn/cw-1738-conditional-requests-for-autofix-feedback-queue-polling
Aug 26, 2026
Merged

alexsohn1126 merged 8 commits into
masterfrom
alexsohn/cw-1738-conditional-requests-for-autofix-feedback-queue-polling

Conversation

@alexsohn1126

@alexsohn1126 alexsohn1126 commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

The autofix drawer polls GET /issues/{id}/autofix/ continuously and each response is ~161 kB, so an open tab burns through a lot of bandwidth.

Using If-None-Match header, we will use the cache if the hash of the payload has not changed.

Example:

image

It is gated by api.conditional_get.enabled option, to disable/enable this caching behaviour.

let's also use metrics (temporarily) to track how much data we are saving by doing this

the best solution would be to stop polling altogether but this is a stopgap while the poll-less version gets implemented

Refs CW-1738.

@linear-code

linear-code Bot commented Aug 12, 2026

Copy link
Copy Markdown

CW-1738

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 12, 2026
The autofix drawer polls this endpoint continuously, and each response is
about 161 kB. Add ETag/If-None-Match so a poll that finds no change costs a
304 instead of the full payload.

Adds a reusable ConditionalGetResponseMixin, gated per endpoint by an option
so it can be turned off without a deploy. Refs CW-1738.
@alexsohn1126
alexsohn1126 force-pushed the alexsohn/cw-1738-conditional-requests-for-autofix-feedback-queue-polling branch from 98e1340 to 408d38a Compare August 12, 2026 20:41
Repository.name is not unique per organization, and the filter spans two
GitHub providers, so same-name rows had no defined order. The last row won
the dict entry, which made the response body differ between web pods.
Some CDNs do not treat "no-cache" as equal to "max-age=0,
must-revalidate", per the note on NO_CACHE in sentry/web/constants.py.
This reverts commit e481127. The CDN caveat behind that change applies to
publicly cacheable responses. This response is private, so a shared cache must
not store it either way, and the two forms are equivalent here.
Every endpoint that inherits the mixin now shares api.conditional_get.enabled.
The per-endpoint attribute allowed a separate option for each endpoint, which
no endpoint needs.
Sum api.conditional_get.body_bytes over result:hit for the bytes a 304 saved,
and over result:miss for the bytes still sent.
These tests mock the run state and never query Snuba.
@alexsohn1126
alexsohn1126 marked this pull request as ready for review August 14, 2026 15:26
@alexsohn1126
alexsohn1126 requested review from a team as code owners August 14, 2026 15:26
@alexsohn1126
alexsohn1126 merged commit 71627fc into master Aug 26, 2026
88 checks passed
@alexsohn1126
alexsohn1126 deleted the alexsohn/cw-1738-conditional-requests-for-autofix-feedback-queue-polling branch August 26, 2026 19:25
sentry-junior Bot added a commit that referenced this pull request Aug 26, 2026

This branch was successfully deployed

1 active deployment
Preview — 4b139c9f Deployed Aug 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants