coreshop / CoreShop

CoreShop - Pimcore enhanced eCommerce
http://www.coreshop.org
Other
277 stars 157 forks source link

[Feature request] Delayed messages are "missing" #2713

Open NiklasBr opened 2 months ago

NiklasBr commented 2 months ago
Q A
Bug report? probably not
Feature request? probably yes
BC Break report? no
RFC? maybe

This issue lives in the gray area between a bug and a missing feature, so not sure how to answer with a clear yes-no above :) Leaning towards a feature request.

Dispatching a message like this with a delay to the availability will cause it to not show in the MessengerBundle interface leading to questions like "did it actually register in the system?"

Should they show? At least as a pending message, right? But maybe not as any other message with immediate availability? What do you think, what is a good way to solve it?

use App\Model\Messenger\ProductFetchMessage;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Messenger\Stamp\DelayStamp;

class FooMessageHandler
{
    public function __construct(private MessageBusInterface $bus) {}

    public function someAction(): void
    {
        $this->bus->dispatch(
            new ProductFetchMessage($itemVariant->getId()),
            [new DelayStamp(86_400_000)]
        );
    }
}

Screenshot 2024-09-13 at 16 46 20

dpfaffenbauer commented 2 months ago

@NiklasBr yes, I would count that as a missing feature

jdreesen commented 2 months ago

I've noticed the same behavior with messages that have failed for some reason and are scheduled for a retry in the future. They are currently invisible, which is a little confusing.

jdreesen commented 2 months ago

If it's a missing feature, will it only be added to 4.x (and thus in Pimcore 11)?

dpfaffenbauer commented 2 months ago

something like this, we can still add to 3.2.x and merge up to 4.0.x and 4.1.x. Only bigger things is what we only do for new minor releases.