Skip to content

Handle events overview when event definition is missing#25548

Open
ryan-carroll-graylog wants to merge 2 commits intomasterfrom
13756-when-an-event-definition-has-been-removed-the-events-overview-widget-will-error-when-trying-to-reference-it
Open

Handle events overview when event definition is missing#25548
ryan-carroll-graylog wants to merge 2 commits intomasterfrom
13756-when-an-event-definition-has-been-removed-the-events-overview-widget-will-error-when-trying-to-reference-it

Conversation

@ryan-carroll-graylog
Copy link
Copy Markdown
Contributor

@ryan-carroll-graylog ryan-carroll-graylog commented Apr 2, 2026

Description

When an event definition is deleted, the Events Overview widget on the search page would throw errors and show error toast notifications if the event definition column was displayed. This change gracefully handles missing event definitions by falling back to displaying the raw event definition ID — matching the existing behavior on the Alerts page.

Motivation and Context

Fixes graylog-plugin-enterprise#13756

When users delete event definitions, existing events still reference the old definition ID. The EventDefinitionName component would attempt to fetch the deleted definition, get a 404, and the defaultOnError wrapper would display an error toast for every affected row. Additionally, the component returned null for the cell content when displayAsLink was true, leaving empty cells.

Changes

  • EventDefinitionName.tsx: When the event definition fetch fails or returns no data, render the event definition ID as plain text instead of returning null
  • useEventDefinition.tsx (in components/events/events/hooks/): Removed defaultOnError wrapper to prevent error toast notifications on expected 404s; exposed isError from the query
  • EventDetails.test.tsx: Updated mocks to include the new isError field

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

@ryan-carroll-graylog ryan-carroll-graylog changed the title Handle case where event definition is missing Handle events overview when event definition is missing Apr 2, 2026
@ryan-carroll-graylog ryan-carroll-graylog marked this pull request as ready for review April 2, 2026 14:00
Copy link
Copy Markdown
Contributor

@zeeklop zeeklop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! tested successfully. Thank you Ryan

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.

2 participants