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

Image Upload Image contentUrl issue on Bot Framework Emulator 4.3.0 #1362

Closed
ikivanc opened this issue Mar 8, 2019 · 4 comments · Fixed by #1661
Closed

Image Upload Image contentUrl issue on Bot Framework Emulator 4.3.0 #1362

ikivanc opened this issue Mar 8, 2019 · 4 comments · Fixed by #1661
Assignees
Labels
Bug Your classic code defect P0 Must Fix. Release-blocker

Comments

@ikivanc
Copy link
Member

ikivanc commented Mar 8, 2019

Version

4.3.0

Describe the bug

Hi Team,

I'm trying to upload an image on new updated Emulator 4.3.0.

It seems like there are some changes however those are not reflected on documentation, I couldn't find them. Also botbuilder sample is not up-to-date too

attachment.ContentUrl format has been changed,

Before the update I was able to access uploaded images in local TEMP directory and I was able to see the image on emulator now It changed to a new format "[object Promise]/v3/attachments/e960b300-41b7-11e9-992f-9fa6f8384922/views/original" 

it uses a localhost IP for new Emulator with ngrok, I'm able to access the image after change like below  
https://myngrokip.ngrok.io/v3/attachments/8fe5b190-41b2-11e9-992f-9fa6f8384993/views/original,

image

I changed manually in my code to access the image using "turnContext.Activity.ServiceUrl". It seems like it's a bug on Emulator and SDK. What is the best practice to access in my code and see my image in emulator as well?

Thanks. 

@a-b-r-o-w-n a-b-r-o-w-n added Bug Your classic code defect P0 Must Fix. Release-blocker 4.4 labels Mar 8, 2019
@tonyanziano
Copy link
Contributor

tonyanziano commented Mar 8, 2019

I believe the [object Promise] prefix of the contentUrl is due to the new way in which the ngrokService retrieves the emulator URL. It used to be a function that returned the url, but now it is an async function (promise).

I wonder if this is causing the issue.

@a-b-r-o-w-n
Copy link
Contributor

a-b-r-o-w-n commented Mar 8, 2019

This is due to a change in an interface for getServiceUrl in commit efdf84d. We need to await here

@EricDahlvang
Copy link
Member

@tonyanziano I'm able to repeat this issue in 4.4.1. Navigating to the url results in:

{"error":{"code":"ServiceError","message":"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type undefined"}}

image

@tonyanziano
Copy link
Contributor

It appears that the previous PR fixed images being uploaded via the Web Chat sendbox, however, the upload from the bot is still broken.

This is addressed in #1661

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Your classic code defect P0 Must Fix. Release-blocker
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants