messenger-monitor-bundle icon indicating copy to clipboard operation
messenger-monitor-bundle copied to clipboard

Duration not decoded correctly for longer tasks

Open maxxer opened this issue 8 months ago • 1 comments

Tasks running for more than 1s are not displayed correctly

Image

Using version ^2.4 for knplabs/knp-time-bundle

maxxer avatar Mar 18 '25 09:03 maxxer

Same in the Snapshot box

Image

maxxer avatar Mar 18 '25 09:03 maxxer

That's weird - what about the ago messages, are they shown correctly? Any details in the web debug toolbar's translation panel?

kbond avatar May 21 '25 23:05 kbond

It all comes from the fact that we haven't configured translation in our app. The whole Scheduler section crashes with An exception has been thrown during the rendering of a template ("The "app.locale" variable is not available.") in schedule.html.twig.

I tried adding minimal localization config to the app (below), but then other issues arise about null arrays and I didn't have the time to chase all of them.

twig:
    globals:
        app:
            locale: 'en'  # Or whatever default language you prefer

maxxer avatar May 22 '25 05:05 maxxer

Hmm, ok, I was a bit perturbed that knp time bundle requires translation. I might look into removing this requirement.

In the meantime, you should be able to remove knp time bundle - it's an optional dependency.

kbond avatar May 22 '25 11:05 kbond

Without knplabs/knp-time-bundle the duration is rendered correctly.

Schedule still won't render due to app.locale

maxxer avatar May 22 '25 14:05 maxxer

Understand now - #150 should fix.

kbond avatar May 22 '25 14:05 kbond

v0.5.3 contains this fix.

kbond avatar May 22 '25 14:05 kbond

I also had translations disabled in the framework config, that did the trick for the |ago filter 😅

maxxer avatar May 23 '25 06:05 maxxer

I see, so you had Symfony/translator installed but actively disabled?

kbond avatar May 23 '25 11:05 kbond

Yeah, I didn't spot it before

  translator:
    enabled: false

maxxer avatar May 23 '25 11:05 maxxer