Skip to content

Comments

fix(sentry): use useMemo for issue filtering to sync with async data#7523

Open
andreahlert wants to merge 3 commits intobackstage:mainfrom
andreahlert:fix/sentry-issues-table-filtering
Open

fix(sentry): use useMemo for issue filtering to sync with async data#7523
andreahlert wants to merge 3 commits intobackstage:mainfrom
andreahlert:fix/sentry-issues-table-filtering

Conversation

@andreahlert
Copy link
Contributor

@andreahlert andreahlert commented Feb 7, 2026

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 useState initializer only runs once on mount, so issues fetched asynchronously were never reflected in the filtered list.

Changes:

  • Replace useState/setFilteredIssues with useMemo derived from [sentryIssues, selected, filterByDate] so the table reactively updates when async data arrives or the filter changes
  • Simplify handleFilterChange to only update the selected period (filtering is handled by useMemo)
  • Add guard clause in ErrorGraph for missing stats data to prevent runtime errors

Fixes #6694

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

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>
@andreahlert andreahlert requested a review from a team as a code owner February 7, 2026 20:32
@andreahlert andreahlert requested review from vinzscam and removed request for a team February 7, 2026 20:32
@backstage-goalie
Copy link
Contributor

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/plugin-sentry workspaces/sentry/plugins/sentry patch v1.14.0

…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>
@andreahlert andreahlert force-pushed the fix/sentry-issues-table-filtering branch from eb1c935 to 9afaff9 Compare February 23, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 sentry: Issue list not working with SaaS offering

3 participants