Coder Social home page Coder Social logo

Comments (7)

mgomes avatar mgomes commented on May 24, 2024 1

Awesome. Thanks for digging all that up. In earlier versions of Stealth we had distinct classes for each flow rather than the flow_map.rb we have now. It looks like that area was missed.

I'll work on a fix asap.

Thanks again!

from stealth.

mgomes avatar mgomes commented on May 24, 2024

from stealth.

luizcarvalho avatar luizcarvalho commented on May 24, 2024

Hello my friend @mgomes, is how it was generated

class CatchAllsController < BotController

  def level1
    send_replies

    if previous_session_specifies_fails_to?
      step_to flow: previous_session.flow_string, state: previous_state.to_s
    else
      step_to session: previous_session - 2.states
    end
  end

private
   def previous_session_specifies_fails_to?
     previous_state.present?
   end

   def previous_state
     previous_session.flow.current_state.fails_to
   end

end

from stealth.

mgomes avatar mgomes commented on May 24, 2024

That's strange. It looks like the level1 state was correctly called per your logs:

[catch_all] CatchAll level1 triggered

Do you have a reply defined for that state named level.yml in replies/catch_alls?. If so does it have any content?

from stealth.

luizcarvalho avatar luizcarvalho commented on May 24, 2024

Very strange.
Yes I have

~/d/5/teste    tree 11.2s  Tue 17 Jul 2018 08:26:10 AM -03
.
├── bot
│   ├── controllers
│   │   ├── bot_controller.rb
│   │   ├── catch_alls_controller.rb
│   │   ├── concerns
│   │   ├── goodbyes_controller.rb
│   │   └── hellos_controller.rb
│   ├── helpers
│   │   └── bot_helper.rb
│   ├── models
│   │   ├── bot_record.rb
│   │   └── concerns
│   └── replies
│   ├── catch_alls
│   │   └── level1.yml
│   ├── goodbyes
│   │   └── say_goodbye.yml
│   └── hellos
│   └── say_hello.yml
├── config
│   ├── boot.rb
│   ├── database.yml
│   ├── environment.rb
│   ├── flow_map.rb
│   ├── initializers
│   ├── puma.rb
│   ├── services.yml
│   └── sidekiq.yml
├── config.ru
├── db
│   └── seeds.rb
├── Gemfile
├── Gemfile.lock
├── Procfile.dev
├── Rakefile
└── README.md

13 directories, 23 files

The content

- reply_type: text
  text: Oops. It looks like something went wrong. Let's try that again

I create a project with this code: https://github.com/luizcarvalho/stealth-teste

from stealth.

luizcarvalho avatar luizcarvalho commented on May 24, 2024

I think the error is happens here, this message is showed, but condition is not satisfied.

        def run_catch_all(reason: nil)
          error_level = fetch_error_level
          Stealth::Logger.l(topic: "catch_all", message: "CatchAll #{calculate_catch_all_state(error_level)} triggered for #{error_slug}: #{reason}")
          # THIS IF
          if defined?(CatchAllsController) && defined?(CatchAllFlow)
            catch_all_state = calculate_catch_all_state(error_level)

            if CatchAllFlow.flow_spec.states.keys.include?(catch_all_state.to_sym)
              step_to flow: 'catch_all', state: catch_all_state
            else
              # We are out of bounds, do nothing to prevent an infinite loop
              Stealth::Logger.l(topic: "catch_all", message: "Stopping; we've exceeded the number of defined catch_all states.")
              return false
            end
          end
        end

look:

08:42:19 sidekiq.1 | [3] pry(#)> defined?(CatchAllsController)
08:42:19 sidekiq.1 | => "constant"
08:42:30 sidekiq.1 | [4] pry(#)> defined?(CatchAllFlow)
08:42:30 sidekiq.1 | => nil
08:42:34 sidekiq.1 | [5] pry(#)> CatchAllFlow
08:42:34 sidekiq.1 | NameError: uninitialized constant Stealth::Controller::CatchAll::CatchAllFlow
08:42:34 sidekiq.1 | from (pry):3:in `run_catch_all'

Here list of all defineds constants: https://gist.github.com/luizcarvalho/25b077521dcbb1e53949fbfd4d805180

from stealth.

luizcarvalho avatar luizcarvalho commented on May 24, 2024

You're welcome, thank you.
😃

from stealth.

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.