fix(sentry): use useMemo for issue filtering to sync with async data#7523
Open
andreahlert wants to merge 3 commits intobackstage:mainfrom
Open
fix(sentry): use useMemo for issue filtering to sync with async data#7523andreahlert wants to merge 3 commits intobackstage:mainfrom
andreahlert wants to merge 3 commits intobackstage:mainfrom
Conversation
The SentryIssuesTable component used useState to initialize filteredIssues from props, but this only ran once on mount. When sentryIssues arrived asynchronously (empty initially), the filtered list stayed empty and never updated. Replace useState + manual setFilteredIssues with useMemo that automatically recalculates when sentryIssues or the selected filter changes. Also add a guard clause in ErrorGraph to handle cases where stats data is missing, preventing potential rendering errors. Fixes backstage#6694 Signed-off-by: André Ahlert <andre@aex.partners>
Signed-off-by: André Ahlert <andre@aex.partners>
Contributor
Changed Packages
|
8 tasks
vinzscam
requested changes
Feb 9, 2026
workspaces/sentry/plugins/sentry/src/components/SentryIssuesTable/SentryIssuesTable.tsx
Outdated
Show resolved
Hide resolved
…mo, shorten changeset - Replace useMemo with simple ternary for filteredIssues (per vinzscam) - Shorten changeset description to user-facing message only Signed-off-by: André Ahlert <andre@aex.partners>
eb1c935 to
9afaff9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey, I just made a Pull Request!
Fixes the Sentry issues table not updating when data arrives from the API. The root cause is that
useStateinitializer only runs once on mount, so issues fetched asynchronously were never reflected in the filtered list.Changes:
useState/setFilteredIssueswithuseMemoderived from[sentryIssues, selected, filterByDate]so the table reactively updates when async data arrives or the filter changeshandleFilterChangeto only update the selected period (filtering is handled byuseMemo)ErrorGraphfor missing stats data to prevent runtime errorsFixes #6694
✔️ Checklist
Signed-off-byline in the message. (more info)