When using CollectingOutputChannel to collect messages, it doesn’t work with dispatch messages inside actions,
out_channel = CollectingOutputChannel()
user_msg = UserMessage(text, out_channel, sender_id)
payload = on_new_message(user_msg)
payload
doesn’t have dispatched messages from actions.
akelad
(Akela Drissner)
August 7, 2018, 1:42pm
2
Yes so dispatched messages from inside actions don’t actually get logged in the tracker. What exactly are you trying to do with this?
It’s because we want to send actual response back to user, but that’s seems to be resolved with the master branch.
The question is in which way tracker events will be send? if your solution is using output channel, it doesn’t work, please see the architectural design problem reported here
opened 05:02AM - 16 Jul 18 UTC
closed 10:42AM - 21 Mar 19 UTC
**Rasa Core version**: master
**Python version**: 3.5
**Operating system**… (windows, osx, ...): debian 9.0
**Issue**:
In `send_text_message` method which used by dispatcher to dispatch data back to user as a output channel, there is a wrong implementation that avoid to function there.
In line https://github.com/RasaHQ/rasa_core/blob/master/rasa_core/channels/custom.py#L35
```python
def send_text_message(self, recipient_id, message):
# you probably use http to send a message
url = self.url
if self.access_token is not None:
headers = {"Auth-token": self.access_token}
else:
headers = {}
requests.post(
url,
message,
headers=headers
)
```
The request module used with post method to reply back to user, but it didn't work and also technically cannot work. The reason is session context used by flask in `route` handler is different than `send_text_message` method inside output channel (or whatever else).
```python
@custom_webhook.route("/webhook", methods=['POST'])
def receive():
payload = request.json
sender_id = payload.get("sender", None)
text = payload.get("message", None)
on_new_message(UserMessage(text, self.out_channel, sender_id))
return "success"
```
Based on current implementation it will issue a post request to a HTTP server resides on client side, since there is no HTTP server there to respond or accept the request, so we are not going to talk about client IP address that could be behind a NAT or another reason.
akelad
(Akela Drissner)
August 9, 2018, 2:44pm
4
Oops, somehow we overlooked this issue, sorry! I’ll make sure someone gets back to you about that on there
1 Like