Comments (7)
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.
from stealth.
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.
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.
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.md13 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.
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.
You're welcome, thank you.
😃
from stealth.
Related Issues (20)
- Run CircleCI tests on Ruby 2.7
- Messages that are alpha ordinals should take precedence
- Add options to flow states
- Add support for "any" message in handle_message()
- Add NLP threshold setting for intent and entity detection
- Configurable expiration time for CaltchAll max fails attempts
- Support alpha ordinals with punctuation
- Error to connect to database HOT 1
- Stealth Twilio Integration HOT 1
- Add support for Array types in handle_message
- Experiment moving test suite to Github Actions HOT 1
- Add test coverage for TruffleRuby HOT 1
- Upgrade to Sinatra 2.1
- Upgrade listen gem to 3.3.x
- Configuration in initialiser ignored HOT 4
- Integration api instagram HOT 1
- Is it possible to mount a Stealth bot inside an existent Rails app? HOT 2
- `Zeitwerk::SetupRequired` for Zeitwerk 2.6.6
- Compatibility with RSpec-Rails
- Send additional context to NLP drivers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stealth.