Giter VIP home page Giter VIP logo

Comments (7)

jankoenig avatar jankoenig commented on June 2, 2024

Thanks for flagging @fbublitz. What a coincidence, @aswetlow and I were just talking about this when the issue came in πŸ˜…

We'll take a closer look and see how this happened!

from jovo-framework.

fbublitz avatar fbublitz commented on June 2, 2024

Amazing :)
Would really like to know how it happens, just out of curiosity.

from jovo-framework.

fbublitz avatar fbublitz commented on June 2, 2024

Hey i found something else, that is related to this i think (and a proper bug ).
i have two global handlers in two different components that handle the same intent, only one of them has an additional @if() decorator, checking on entity value

@Component()
class compA extends BaseComponent {
   @Global()
   @Intents( 'intentName' )
   handlerA() {
      // do something
   };
}

@Component()
class compB extends BaseComponent {
   @Global()
   @Intents( 'intentName' )
   @If( (jovo: Jovo) => jovo.$entities.entityType?.resolved === 'expectedValue' )
   handlerB() {
      // do something
   };
}
  1. unit test makes a request that has intentName and entityType with value expectedValue . It fails because handlerA matches instead of handlerB. According to documentation the handler that satisfies the most conditions should match.
  2. When i put compB before compA in the app.ts component array, the test succeeds. So effect of ordering shows up here too.

from jovo-framework.

jrglg avatar jrglg commented on June 2, 2024

from jovo-framework.

rmtuckerphx avatar rmtuckerphx commented on June 2, 2024

@jankoenig Maybe we should add the ability to give a priority ordering to handlers that the router would use?

from jovo-framework.

jankoenig avatar jankoenig commented on June 2, 2024

Thank you for the details @fbublitz πŸŽ‰

from jovo-framework.

aswetlow avatar aswetlow commented on June 2, 2024

We published the update yesterday. v4.4.0

from jovo-framework.

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.