ItemsIndexedEvent represents processed (all) items as successfully indexed, when some may be rejected

Created on 14 January 2023, over 1 year ago
Updated 21 May 2024, 4 months ago

Problem/Motivation

IndexedItemsEvent has a ::getProcessedIds() method which returns all the processed IDs, which is the combination of the indexed and rejected items. Problem is, the docblock says that it returns "An array containing the successfully indexed items' IDs." This just isn't true. Problem is that the event's name and the phpdoc on the method indicate this is to react to successful indexing.

Steps to reproduce

Reject some items during indexing and observe they are contained in the returned array from the method.

Proposed resolution

Provide two new methods and amend the constructor to provide information about rejected items, as well as retrieving the truly indexed items.

Since changing the return value of the current method would be a BC break, fix the phpdoc on it (the return value does fit the name of the method, at least) and publish a CR that indicates users should use the correct method based on the info they need.

This also fixes a number of phpdoc return types while we're at it.

Remaining tasks

Review.

Feature request
Status

Needs review

Version

1.0

Component

Framework

Created by

🇺🇸United States bradjones1 Digital Nomad Life

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024