Skip to content

fix(resultGrid): Migrate api.request to api.requestPromise#118265

Merged
ryan953 merged 2 commits into
masterfrom
seer/fix/frontend-tsc-35-result-grid-api
Jun 23, 2026
Merged

fix(resultGrid): Migrate api.request to api.requestPromise#118265
ryan953 merged 2 commits into
masterfrom
seer/fix/frontend-tsc-35-result-grid-api

Conversation

@sentry

@sentry sentry Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Refactors the API call in static/app/components/resultGrid.tsx to comply with the no-callback-api-request rule.

Previously, the component used api.request with success and error callbacks. This change migrates the call to use api.requestPromise within an async function and a try/catch block, leveraging modern async/await patterns.

includeAllArgs: true was added to requestPromise options to ensure that response headers (specifically the 'Link' header for pagination) remain accessible, preserving existing functionality.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes FRONTEND-TSC-35

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 23, 2026
Comment thread static/app/components/resultGrid.tsx Outdated
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 93.79% 93.79% ±0%
Typed 132,934 132,936 🟢 +2
Untyped 8,797 8,797 ±0
🔍 2 new type safety issues introduced

any-typed symbols (2 new)

File Line Detail
static/app/components/resultGrid.tsx 229 data (var(binding))
static/app/components/resultGrid.tsx 229 resp (var(binding))

This is informational only and does not block the PR.

@ryan953 ryan953 requested a review from a team June 23, 2026 18:47
@ryan953 ryan953 added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Jun 23, 2026
…ponses

Implement cleanup function in useEffect to prevent stale data from overwriting
newer results. Uses an isCancelled flag that is checked before calling setState,
ensuring that only the most recent request updates the component state.

This fixes the race condition where slower requests could complete after faster
ones when dependencies change rapidly, particularly when persistInFlight is enabled.

Co-authored-by: Ryan Albrecht <ryan@ryanalbrecht.ca>
@github-actions github-actions Bot removed the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Jun 23, 2026
@ryan953 ryan953 added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Jun 23, 2026
@ryan953 ryan953 enabled auto-merge (squash) June 23, 2026 18:56
@ryan953 ryan953 merged commit a1ae2cf into master Jun 23, 2026
84 of 85 checks passed
@ryan953 ryan953 deleted the seer/fix/frontend-tsc-35-result-grid-api branch June 23, 2026 19:02
sehr-m pushed a commit that referenced this pull request Jun 23, 2026
Refactors the API call in `static/app/components/resultGrid.tsx` to
comply with the `no-callback-api-request` rule.

Previously, the component used `api.request` with `success` and `error`
callbacks. This change migrates the call to use `api.requestPromise`
within an `async` function and a `try/catch` block, leveraging modern
`async/await` patterns.

`includeAllArgs: true` was added to `requestPromise` options to ensure
that response headers (specifically the 'Link' header for pagination)
remain accessible, preserving existing functionality.

<!--

  Sentry employees and contractors can delete or ignore the following.

-->

### Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.

Fixes
[FRONTEND-TSC-35](https://sentry.sentry.io/issues/7553133111/?seerDrawer=true)

---------

Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ryan Albrecht <ryan@ryanalbrecht.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants