Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SkillDialog not working for non-'expected replies' scenario #878

Closed
axelsrz opened this issue Mar 20, 2020 · 0 comments · Fixed by #886
Closed

SkillDialog not working for non-'expected replies' scenario #878

axelsrz opened this issue Mar 20, 2020 · 0 comments · Fixed by #886
Assignees
Labels
bug Indicates an unexpected problem or an unintended behavior. P0 Must Fix. Release-blocker R9 Release 9 - May 6th, 2020
Milestone

Comments

@axelsrz
Copy link
Member

axelsrz commented Mar 20, 2020

Version

4.8.0

Describe the bug

SkillDialog won't work out of the box for non expected-replies scenarios.

To Reproduce

Steps to reproduce the behavior:

  1. Set up a root bot using skill dialog and a skill bot
  2. Run both bots and initiate the SkillDialog
  3. When the skill first comes back to the parent an error like the following should arise:
File "..path-to-botbuilder/botbuilder-python/libraries/botbuilder-dialogs/botbuilder/dialogs/skills/skill_dialog.py", line 213, in _send_to_skill
    if not 200 <= response.status <= 299:
AttributeError: 'NoneType' object has no attribute 'status'

Expected behavior

The response get back to the parent without any problems

Workaround

If the skill bot is modified to always send some content in every successful response at the route handler level, the scenario should work.

Example on how to do this for an aiohttp skill bot:

#This is how a typical message handler method could look like
async def messages(req: Request) -> Response:
    # Main bot message handler.
    if "application/json" in req.headers["Content-Type"]:
        body = await req.json()
    else:
        return Response(status=415)

    activity = Activity().deserialize(body)
    auth_header = req.headers["Authorization"] if "Authorization" in req.headers else ""

    response = await ADAPTER.process_activity(activity, auth_header, BOT.on_turn)
    if response:
        return json_response(data=response.body, status=response.status)
    # THE FIX IS IN THE LINE BELOW
    return Response(status=201, body='{"foo":"bar"}'.encode("utf-8"))

Alternative Workaround: use expected replies as delivery method in the parent bot (SkillDialog).

[bug]

@axelsrz axelsrz added the P0 Must Fix. Release-blocker label Mar 20, 2020
@axelsrz axelsrz self-assigned this Mar 20, 2020
@github-actions github-actions bot added bug Indicates an unexpected problem or an unintended behavior. "Content-Type" labels Mar 20, 2020
@tracyboehrer tracyboehrer added the R9 Release 9 - May 6th, 2020 label Mar 24, 2020
@munozemilio munozemilio added this to the R9 milestone Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. P0 Must Fix. Release-blocker R9 Release 9 - May 6th, 2020
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants