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

Is there a limit on storing data on the "Session" object?

Open matheus208 opened this issue 10 years ago • 5 comments

I am trying to store a relatively large JSON on the session.userData object, but I'm getting the following error:

[Error: Request to 'https://state.botframework.com/v3/botstate/facebook/users/10209714280037543' failed: [400] Bad Request]

It works when the session is empty, but somewhere along the way after storing a lot of data, I get this error.

Has anyone else faced this? Any workarounds to make it work?

matheus208 avatar Jul 28 '16 21:07 matheus208

@matheus208 I believe the limit is 64Kb -- do you know how much data you're attempting to store?

muzahmed avatar Aug 01 '16 18:08 muzahmed

It's 32kb according to https://docs.botframework.com/en-us/restapi/state/

danmarshall avatar Aug 11 '16 01:08 danmarshall

I'm going to close this issue for now, but feel free to open a new issue for further discussion.

If you need to store large amounts of data, you might consider a store specialized for that purpose. For example, sql for relational data, blobs for large binary data, search for semi-structured text data, etc.

willportnoy avatar Aug 12 '16 23:08 willportnoy

so what happens when you cross that limit? does the bot crash? does it delete older entries and keep newer ones?

slidenerd avatar Sep 24 '16 15:09 slidenerd

@slidenerd; In my experience, the error OP posted comes up and your bot won't reply to anything. I was trying to store message history, but once it got over a certain size the bot would freak out and stop doing anything.

scottmcconnell avatar Jan 25 '17 00:01 scottmcconnell