Skip to content

fix(actionCreators): Migrate mergeGroups to async/await and remove callbacks - #126252

Closed
sentry[bot] wants to merge 2 commits into
masterfrom
seer/fix/merge-groups-async-await
Closed

sentry[bot] wants to merge 2 commits into
masterfrom
seer/fix/merge-groups-async-await

Conversation

@sentry

@sentry sentry Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

This PR addresses the no-callback-api-request coding convention violation in static/app/actionCreators/group.tsx related to the mergeGroups function.

Problem:
The mergeGroups function was partially migrated to use api.requestPromise with async/await, but it still accepted and invoked options.success, options.error, and options.complete callbacks. This hybrid approach violated the coding convention which mandates promise-based error handling over callback patterns.

Solution:

  1. static/app/actionCreators/group.tsx (mergeGroups):
    • Removed the options: RequestCallbacks parameter.
    • Modified the function to return the API response data directly upon success.
    • Ensured errors are re-thrown, allowing callers to handle them with try/catch.
  2. static/app/views/issueList/actions/index.tsx (Call Site 1):
    • Removed the now-unnecessary empty {} third argument passed to mergeGroups.
    • Added a .catch(() => {}) to the mergeGroups call to prevent unhandled promise rejections for this fire-and-forget usage.
  3. static/app/views/issueDetails/groupSimilarIssues/similarStackTrace/index.tsx (Call Site 2):
    • Replaced the new Promise((resolve, reject) => { mergeGroups(..., {success, error}) }) wrapper with a direct mergeGroups(api, {...}) call, leveraging the function's new promise-returning nature.

Note: The RequestCallbacks import in static/app/actionCreators/group.tsx has been retained as bulkDelete and bulkUpdate still utilize this callback pattern and will require separate migrations.

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 CODING-CONVENTIONS-4KZ

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

…llbacks

Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
@sentry
sentry Bot requested review from a team as code owners October 1, 2026 22:36
@sentry sentry Bot assigned ryan953 Oct 1, 2026
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 1, 2026
@ryan953 ryan953 added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Oct 1, 2026
@ryan953

ryan953 commented Oct 2, 2026

Copy link
Copy Markdown
Member

dupe of #126268

@ryan953 ryan953 closed this Oct 2, 2026

This branch was successfully deployed

1 active deployment
Preview — b3a20d89 Deployed Oct 1, 2026 by vercel[bot]
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.

1 participant