Queue worker unnecessary reload of entity and message

Created on 9 December 2021, over 2 years ago
Updated 29 January 2024, 5 months ago

Problem/Motivation

In MessageSubscribe::processItem (the QueueWorker), we have the following code:

   $message = $data['message'];
    $entity = $data['entity'];
    ...
    // Reload message and entity.
    $message = $message->load($message->id());
    $entity = $entity->load($entity->id());

Why should we reload those entities?
I set it as a bug because, in my use case, I store some extra properties in those objects (attached documents) and they are lost due to this reloading. The message system is working very well without this reloading

πŸ’¬ Support request
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium DuneBL

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

Comments & Activities

Not all content is available!

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

  • πŸ‡ΊπŸ‡ΈUnited States bluegeek9

    The message could have changed since it was queued. What data are you storing on the Message entity? Would it not be better to store that data in a field?

Production build 0.69.0 2024