codeforequity-at / botium-core

The Selenium for Chatbots - Bots Testing Bots
https://www.botium.ai
MIT License
230 stars 64 forks source link

Directline attachments don't work anymore #405

Closed alopix closed 4 years ago

alopix commented 5 years ago

Describe the bug Trying to upload an attachment using the latest version of the directline connector does not work anymore. The emulator will send an error back that path is not available in unknown. Downgrading to one older version will make it work again.

To Reproduce Use MEDIA with a directline convo and connect to a local bot through the botframework emulator.

Expected behavior Upload works and id for attachment is being returned.

Screenshots and Log files

Botium Flavour:

Botium Version 1.6.1

Additional context

codeforequity-at commented 5 years ago

Is it possible that the botframework emulator is behaving different than the real azure bot service ? We are using the Bot Framework MockBot for testing the connector features in Botium Box, and the attachment upload (at least for PNG pictures) is working there

alopix commented 5 years ago

I'm not sure what exactly changed in your last connector code, but whatever change it is, I expect the file not being properly uploaded anymore?!

I would not expect the official emulator to really behave any differently, but it might – probably requires involving Microsoft in the comms.

codeforequity-at commented 5 years ago

hm, I had to do some changes to make it work with the azure service - I had to add the mime type of the attachment, and I just noticed that this is a constant value "image/png" - not the best choice ...

codeforequity-at commented 5 years ago

Can you tell me your setup, or point me to a source where your setup is described - I am not an expert in Bot Framework ... I want to try to reproduce it in my dev environment before doing anything for fixing it ...

alopix commented 5 years ago

Simple example: directline_attachments_botium.zip

codeforequity-at commented 5 years ago

Thanks. I am always receiving the same error message in the Bot Framework Emulator - "Cannot read property 'name' of undefined" with the previous connector version, "Cannot read property 'path' of undefined" with the current connector version.

What version of the connector and the Bot Framework Emulator did work for you ? (I download the latest one 4.5.2)

alopix commented 5 years ago

Connector is the latest, see package.json. BFE is latest as well, so 4.5.2.

codeforequity-at commented 5 years ago

Yes, I know that this combination doesn't work ... but the 0.0.14 version of the connector doesn't work as well for me ...

I am trying to debug the Bot Framework Emulator to find the root cause

alopix commented 5 years ago

I have no issue using 0.0.14.

yarn run v1.19.1
$ jest
 PASS  spec/convo.spec.js
  custom_hooks_stop_working
    ✓ login with custom hook (2018ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        4.68s
Ran all test suites.
✨  Done in 6.58s.
➜  directline_attachments_botium

Pinning the version: directline_attachments_botium.zip

codeforequity-at commented 5 years ago

Now this is a nice one. What I found out:

The pull request is there, and it will be merged with the October release. Maybe you can check out the branch and test it: https://github.com/codeforequity-at/botium-connector-directline3/pull/31

alopix commented 5 years ago

Oh, that is quite an interesting – quite an annoying issue with fetch. I tried he branch and it worked as expected. Thanks 👍🏼