msbotframework-mongo-middlelayer icon indicating copy to clipboard operation
msbotframework-mongo-middlelayer copied to clipboard

MongoError: The dotted field 'BotBuilder.Data.PreferredLocale' in 'data.BotBuilder.Data.PreferredLocale' is not valid for storage.

Open alamusi opened this issue 8 years ago • 5 comments

Apparently, the BotBuilder.Data.PreferredLocale is stored as part of the userData, instead using a different rowKey like others, such as BotBuilder.Data.SessionState

The problem: when session.preferredLocale('zh-CN') is called, this invalid mongo field (BotBuilder.Data.PreferredLocale) is added under userdata.

The solution:

  1. remove the rowKey condition check for 'userData' on line 32 and 56.
  2. replace the '@' with '\uff0e' (utf16 dot symbol as mongo suggested) on line 33 and 57.

alamusi avatar Apr 19 '18 00:04 alamusi

Thanks for report, Asap i Will look into it

aakashkag avatar Apr 19 '18 11:04 aakashkag

Much appreciated! Right now we workaround it by patching the insertOrReplace and retrieve functions at runtime. It would be great if we have this issue taken care in the repo!

Thanks!

alamusi avatar Apr 19 '18 18:04 alamusi

fixed issue in [email protected] version Thanks for point out solution. feel free to reopen if you found any issue.

aakashkag avatar May 03 '18 11:05 aakashkag

@aakashkag did you forget to commit in the changes?

alamusi avatar May 03 '18 17:05 alamusi

I updated in npm module. it is fixed in [email protected], also updated code in github code as well

aakashkag avatar May 04 '18 07:05 aakashkag