Expose payload as a views filter

Created on 6 December 2023, over 1 year ago

Problem/Motivation

The queue listing page is a view so people can customise it, except that you cannot add a filter for the payload. This is probably because it is serialized data, but with the recent new feature of being able to retry failed jobs, it is almost impossible to find jobs to retry without being able to search by payload.

For example, we have 65000 jobs in the queue. We are completely unable to use the retry feature because there is no way to find a job to retry, so we still have to manually search in the database using a LIKE query to find a job with a particular payload (e.g. recurring order).

Steps to reproduce

Edit the advancedqueue_jobs view and try to add a filter for payload.

Proposed resolution

Expose the payload field to views as a string so that it can be used with a "contains" field by anyone who wants to.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom Rob230

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

Merge Requests

Comments & Activities

  • Issue created by @Rob230
  • πŸ‡¬πŸ‡§United Kingdom Rob230

    Patch for this.

  • πŸ‡¬πŸ‡§United Kingdom Rob230
  • πŸ‡¬πŸ‡§United Kingdom ippy

    Nice one, thank you for a very simple but useful addition. I stumbled here when checking whether such a feature existed. The patch applied cleanly to * 1.0.0-rc7 (Drupal 9.5.9)

    Being able to search through thousands of payloads in order to identify and/or retry or remove the occasional job is really very helpful.

    This enables a UI approach that admins can understand and make use of, here to avoid spamming customers who did not attend an event. A (custom) cancel event occasionally fails to fire - leaving notifications remaining in the queue rather than being identified and deleted automatically. Being able to quickly identify these is great.

    Overall this seems like a useful and non-controversial addition to the project.
    +1

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.2.1 + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Composer require failure
  • πŸ‡΅πŸ‡ΉPortugal jcnventura

    This is not really a bug, so moving it to the correct category. Also, there is a patch proposed, so the correct status is "Needs review".

    And finally, maybe @ippy would like to change the status to "Reviewed & tested by the community", so that this actually has a chance of being committed?

  • First commit to issue fork.
  • Pipeline finished with Success
    3 months ago
    Total: 158s
    #504663
  • πŸ‡©πŸ‡ͺGermany IT-Cru Munich

    @jcnventura: I've tested patch #2 from @rob230 with advancedqueue 8.x-1.4 and it worked as expected. Before patch payload field was not available as filter in views. After apply of patch it was available and also useable as exposed filter to search advancedqueue payload of items for user given strings.

    I've created a MR against 8.x-1.x which is based on #2 patch without any additional changes.

    Moved issue to RVTC.

  • First commit to issue fork.
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    I've tested this MR and added the filter to the default view provided by the module so new sites will benefit. Existing sites can add it themselves as updating existing views is harder and there are situations that are hard to account for.

    Test evidence

  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    I think this is more of task than a full on feature request.

  • Pipeline finished with Skipped
    24 days ago
    #547971
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ
  • Status changed to Fixed 10 days ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024