Guikingone / SchedulerBundle

Repetitive tasks as a breath in Symfony
MIT License
111 stars 10 forks source link

bug(serializer): TraceableNormalizer usage #274

Closed tacman closed 2 years ago

tacman commented 2 years ago

Starting from a new project:

symfony new scheduler_demo --webapp && cd scheduler_demo
composer require guikingone/scheduler-bundle
echo "scheduler_bundle: { transport: { dsn: 'filesystem://first_in_first_out' } }" > config/packages/scheduler.yaml
bin/console scheduler:list

The error (0.9.3):

  The datetime normalizer is not an instance of Symfony\Component\Serializer\Normalizer\DateTimeNormalizer.                                                                                                           

The error (main branch):

In TaskNormalizer.php line 204:                                                   
  Warning: Undefined array key "taskInternalType"                                                     

scheduler:list [--expression [EXPRESSION]] [-s|--state [STATE]]

The issue is that the normalizer being passed in is of type Symfony\Component\Serializer\Debug\TraceableNormalizer.

I added a line to display the problematic class in the exception, I'll submit a PR.

Guikingone commented 2 years ago

Hi @tacman 👋🏻

Seems strange, @nfragnet, wasn't it the type of error that you faced with the RC version? 🤔

Guikingone commented 2 years ago

Hi @tacman 👋🏻

I followed the reproduction steps that you listed earlier, locally, it works without any issues (it requires to do a c:c to schedule the tasks but once done, everything works as expected) when using 0.9.3.

I just opened #277 to improve the conditions and command display, could you test it via dev-issue/277 in your local project and see if it fix the issue?

Thanks 🙂

tacman commented 2 years ago

Indeed, use cache:clear after the bundle install fixes the problem. I thought composer did that automatically. Hmm.