Skip to content

Conversation

Copy link

Copilot AI commented Jan 29, 2026

Summary

This PR adds support for displaying delayed message information in the MessengerBundle admin interface, addressing the feature request where messages dispatched with DelayStamp were not showing any indication of their delayed status.

Changes

  • Added delay property to MessageDetails class to track message delay information
  • Updated MessageRepository to extract DelayStamp information from message envelopes
  • Use Carbon's diffForHumans for human-readable delay formatting with multiple parts (e.g., "1 day 2 hours")
  • Updated frontend JavaScript to display the "Delay" column in pending messages grid
  • Added translations for the new column header (English and German)
  • Passed code review
  • Passed CodeQL security checks

How it works

When messages are dispatched with a DelayStamp, the delay duration is extracted from the envelope and displayed using Carbon's diffForHumans method (e.g., "1 day 2 hours"). Messages without a delay stamp will show an empty delay column, indicating they are available for immediate processing.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature request] Delayed messages are "missing"</issue_title>
<issue_description>| 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
</issue_description>

Comments on the Issue (you are @copilot in this section)

@dpfaffenbauer @NiklasBr yes, I would count that as a missing feature @dpfaffenbauer 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.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add pending message display for delayed messages Add delay information display for pending messages in MessengerBundle Jan 29, 2026
Copilot AI requested a review from dpfaffenbauer January 29, 2026 12:00
@sonarqubecloud
Copy link

return $stamp?->getId();
}

private function getDelayInfo(Envelope $envelope): ?string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for this method @copilot can try to use

use Carbon\Carbon;
use Carbon\CarbonInterface;

$diff = Carbon::now()->subMilliseconds($delayMs);
return Carbon::now()->diffForHumans(other: $diff, syntax: CarbonInterface::DIFF_ABSOLUTE, parts: 2);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:D

@copilot listen to this man :)

@github-actions
Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@dpfaffenbauer
Copy link
Member

@copilot

use Carbon\Carbon;
use Carbon\CarbonInterface;

$diff = Carbon::now()->subMilliseconds($delayMs);
return Carbon::now()->diffForHumans(other: $diff, syntax: CarbonInterface::DIFF_ABSOLUTE, parts: 2);

Copy link
Author

Copilot AI commented Jan 29, 2026

@copilot

...

Updated to use Carbon's diffForHumans in commit fb7f167. The delay is now formatted with up to 2 parts (e.g., "1 day 2 hours").

@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants