botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[Node] Storing canvas in session causes error

Open hgjkant opened this issue 10 years ago • 6 comments

Hi,

in one of our use cases some data can be retrieved from a server which can have a base64 encoding of a canvas in it. I am not exactly sure if it's stored in the userData, but somewhere down the line an error is thrown.

Error: Request to 'https://state.botframework.com/v3/botstate/slack/users/<userID>' failed: [400] Bad Request
    at Request._callback (/bot/node_modules/botbuilder/lib/bots/ChatConnector.js:414:46)
    at Request.self.callback (/bot/node_modules/request/request.js:187:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (/bot/node_modules/request/request.js:1044:10)
    at emitOne (events.js:77:13)
    at Request.emit (events.js:169:7)
    at IncomingMessage.<anonymous> (/bot/node_modules/request/request.js:965:12)
    at emitNone (events.js:72:20)
    at IncomingMessage.emit (events.js:166:7)

hgjkant avatar Aug 25 '16 14:08 hgjkant

How much data are you trying to store?

https://docs.botframework.com/en-us/technical-faq/#is-there-a-limit-on-the-amount-of-data-i-can-store-using-the-state-api

willportnoy avatar Aug 25 '16 17:08 willportnoy

I'm not sure how much it is, but the canvas results in a lot of data so that could be it.

hgjkant avatar Aug 28 '16 14:08 hgjkant

Hi @hgjkant , was that the issue? was this solved? thanks!

Andrea-Orimoto avatar Aug 29 '16 23:08 Andrea-Orimoto

I haven't been able to test this yet, I'll be able to tomorrow.

hgjkant avatar Aug 30 '16 10:08 hgjkant

I tried this again, and a canvas works. There were more than one in when the original error occurred, so I am assuming the session became too big to store. On a side note: when the bot tries to send a message to the user that is too big, it gives an error to explain that, it would be nice it that would be possible for the session too.

hgjkant avatar Sep 02 '16 08:09 hgjkant

Yes - I agree, better diagnostics would be nice. I'll add this to our internal backlog.

willportnoy avatar Sep 02 '16 15:09 willportnoy