XftItemEventCriteria doesn't consider multi-item events when matching

Description

When checking whether an event matches a particular event handler, AbstractXftItemEventHandlerMethod.matches(XftItemEventI) calls the XftItemEventCriteria.matches(XftItemEventI) method, which uses a predicate that calls XftItemEventI.getId().

The problem is that, if the event has multiple IDs, this causes an exception to be thrown, as shown in the attached application.log file.

For the specific case where I ran into this (updating multiple data types in one action), it would suffice to change to this:

The event wasn't for XdatUsergroup, so it never would have gotten to the ID check. However, there's a legitimate use case for an event with the XdatUsergroup XSI type and multiple IDs, so the criteria and event class should handle it properly.

To recreate this error, go to Administer -> Data Types, change something in two or more data types (e.g. add "1" to the codes), then click Save.

Environment

None

Steps to Reproduce

None

Summary of Technical Changes

None

Root Cause Analysis

None

QA Notes

None

Attachments

1

Activity

Show:

Z-Rick Herrick December 13, 2021 at 10:03 PM

Fixed dumb typo in check for multi-item event.

Charlie Moore December 13, 2021 at 5:07 PM

I'm seeing a couple of weird test failures on the internal test VM. I'm not sure if it's related, or if this is just a red herring, but the logs are getting spammed with this:

Z-Rick Herrick December 10, 2021 at 9:55 PM

Added check for multi-item state and adjusted ID check based on that. I'm not sure how to test for this situation to verify the fix. I think the event that caused the log entry attached to the issue was actually created by a plugin.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Time remaining

0h

Components

Fix versions

Affects versions

Priority

Zendesk Support

Clockify

Created October 20, 2021 at 6:26 PM
Updated February 8, 2022 at 10:35 PM
Resolved December 13, 2021 at 10:03 PM