Skip to content

Handle events overview when event definition is missing (7.0)#25735

Merged
ryan-carroll-graylog merged 1 commit into7.0from
backport-7.0/13756-when-an-event-definition-has-been-removed-the-events-overview-widget-will-error-when-trying-to-reference-it
Apr 21, 2026
Merged

Handle events overview when event definition is missing (7.0)#25735
ryan-carroll-graylog merged 1 commit into7.0from
backport-7.0/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

Note: This is a backport of #25548 to 7.0.

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)

* Handle case where event definition is missing

* add cl entry

(cherry picked from commit c53ffba)
Copy link
Copy Markdown
Contributor

@kingzacko1 kingzacko1 left a comment

Choose a reason for hiding this comment

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

tests successfully for me

@ryan-carroll-graylog ryan-carroll-graylog marked this pull request as ready for review April 21, 2026 13:49
@ryan-carroll-graylog ryan-carroll-graylog merged commit e4ac176 into 7.0 Apr 21, 2026
17 checks passed
@ryan-carroll-graylog ryan-carroll-graylog deleted the backport-7.0/13756-when-an-event-definition-has-been-removed-the-events-overview-widget-will-error-when-trying-to-reference-it branch April 21, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants