Giter Site home page Giter Site logo

Comments (7)

Guikingone avatar Guikingone commented on June 11, 2024 1

Hi @babeuloula 👋🏻

I'm gonna take time to investigate this bug, it should be merged for 0.4.3 🙂

from schedulerbundle.

Guikingone avatar Guikingone commented on June 11, 2024 1

Hi @babeuloula 👋🏻

Strange situation, I'm gonna keep an eye on this issues and add more tests to confirm that every task type can be used in Doctrine bridge avec with Messenger integration, I'm closing this PR but working on background on this use case.

Thanks again for the feedback 🙂

from schedulerbundle.

Guikingone avatar Guikingone commented on June 11, 2024

Hi @babeuloula 👋🏻

Strange behaviour here, I've tried to reproduce the bug locally in the tests, I don't find a way 🤔

Regarding the following comment:

You test a serializer but it's not a normalizer instead ?

The test is written around the serializer as we need a serializer to use ObjectNormalizer, here's a test that tries to reproduce the context:

public function testMessengerTaskCanBeNormalized(): void
    {
        $objectNormalizer = new ObjectNormalizer(null, null, null, new PropertyInfoExtractor([], [new PhpDocExtractor(), new ReflectionExtractor()]));
        $notificationTaskBagNormalizer = new NotificationTaskBagNormalizer($objectNormalizer);

        $normalizer = new TaskNormalizer(
            new DateTimeNormalizer(),
            new DateTimeZoneNormalizer(),
            new DateIntervalNormalizer(),
            $objectNormalizer,
            $notificationTaskBagNormalizer
        );

        $serializer = new Serializer([
            $notificationTaskBagNormalizer,
            $normalizer,
            new DateTimeNormalizer(),
            new DateIntervalNormalizer(),
            new JsonSerializableNormalizer(),
            $objectNormalizer
        ], [new JsonEncoder()]);
        $objectNormalizer->setSerializer($serializer);

        $task = (new MessengerTask(uniqid(), new FooMessage()))
            ->setExpression('* * * * *')
            ->setTimezone(new DateTimeZone('Europe/Paris'))
            ->setSingleRun(true)
        ;

        $data = $normalizer->normalize($task, 'json');

        self::assertArrayHasKey('taskInternalType', $data);
        self::assertSame(MessengerTask::class, $data['taskInternalType']);
        self::assertArrayHasKey('body', $data);
        self::assertArrayHasKey('message', $data['body']);
        self::assertArrayHasKey('class', $data['body']['message']);
        self::assertArrayHasKey('payload', $data['body']['message']);
    }

The test is valid, maybe I miss something? 🤔

PS: Here's the related PR: #66

from schedulerbundle.

babeuloula avatar babeuloula commented on June 11, 2024

Hello,

🤔 Monday I will try to reproduice and I will send you a public repo with the bug.

from schedulerbundle.

babeuloula avatar babeuloula commented on June 11, 2024

Hello @Guikingone, you can clone this repo and test it.

If you have an error with mkcert, just comment this line and use 8888 instead of 80.

from schedulerbundle.

Guikingone avatar Guikingone commented on June 11, 2024

Hi @babeuloula 👋🏻

I'm seeing that you're using 0.4.1, could you update your dependencies to 0.4.2 and test again the process ? 🤔

I've tested locally and via the repository, both succeed 🙁

from schedulerbundle.

babeuloula avatar babeuloula commented on June 11, 2024

Hello @Guikingone,

I don't know why and how but I've restart a new project with the same dependencies and I've no longer this issue. It's very weird ...

If you can't reproduice this bug (and now me) I can't explain where the problem come from.

Thanks for your time.
You can close this issue if you want.

from schedulerbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.