Code Monkey home page Code Monkey logo

Comments (5)

Ciboulette avatar Ciboulette commented on June 5, 2024

ok @geomagilles , understood! I will have a look.

So I still do not understand why it was throwing a modified decider exception in Production & not in development?

from zenaton-node.

Ciboulette avatar Ciboulette commented on June 5, 2024

Good news from what I can see, we do not have this behaviour in the php-sdk

from zenaton-node.

Ciboulette avatar Ciboulette commented on June 5, 2024

This is the job sent in Node.js to the agent in the executeHTTP CALL
%{"branch" => 0, "duration" => 10, "event" => nil, "input" => "{\"v\":\"1.0.0\",\"s\":[{\"k\":[\"event\"],\"v\":[null]}],\"o\":\"@zenaton#0\"}", "maxProcessingTime" => nil, "name" => "_Wait", "position" => "1", "sync" => true, "timestamp" => nil, "type" => "wait"}

This is the job sent in PHP to the agent in the executeHTTP CALL
%{"branch" => 0, "duration" => 5, "event" => nil, "input" => "{\"a\":{\"event\":null,\"_buffer\":[[\"seconds\",5]]},\"s\":[]}", "maxProcessingTime" => nil, "name" => "Zenaton\\Tasks\\Wait", "position" => "1", "sync" => true, "timestamp" => nil, "type" => "wait"}

As you can see, the parameter sent with the wait are not included in the input serialization in Node.js, this is why the hash is the same and so it does not generate a ModifiedDeciderException.

Now I'm wondering why it was generating one in production, we should have a deeper look to Amine's workflow

from zenaton-node.

Ciboulette avatar Ciboulette commented on June 5, 2024

So I dug a little bit more,

In Node.js, the JobBox.js in the Agent has data[ATTRIBUTE_INPUT] = serializer.encode(this.job.data);

And for a wait, this.job.data has only the event properties, not the _buffer like in PHP.

I believe this is something we don't want. After having a look to the waitClass here:
https://github.com/zenaton/zenaton-node/blob/master/src/async/Tasks/Wait.js

You can see that it apply a WaitTimestamp trait:
https://github.com/zenaton/zenaton-node/blob/master/src/async/Traits/WithTimestamp.js, where properties _buffer is used

And the Trait class is defined here, https://github.com/zenaton/zenaton-node/blob/master/src/async/Services/Trait.js

You can see that the apply method is:

mix.apply(this, [baseClass.prototype].concat(traits));

  return baseClass;

I may be wrong because it's voodoo JS to me, but I believe this is injecting trait properties to the base this of the waitClass and we maybe want to be injected in this.data

@jalric your help will be appreciated ;)

from zenaton-node.

jalric avatar jalric commented on June 5, 2024

Fixed.

from zenaton-node.

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.