Skip to content

Handle events overview when event definition is missing (6.3)#25736

Draft
ryan-carroll-graylog wants to merge 1 commit into6.3from
backport-6.3/13756-when-an-event-definition-has-been-removed-the-events-overview-widget-will-error-when-trying-to-reference-it
Draft

Handle events overview when event definition is missing (6.3)#25736
ryan-carroll-graylog wants to merge 1 commit into6.3from
backport-6.3/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 6.3.

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

@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 to me. Thank you for the fix.

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

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.

3 participants