wingbot 3.45.1 → 3.45.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/BotApp.js +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.45.1",
3
+ "version": "3.45.2",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/BotApp.js CHANGED
@@ -198,7 +198,9 @@ class BotApp {
198
198
  registerAnalyticsStorage (analyticsStorage, options = {}) {
199
199
  const log = this._logger || options.log;
200
200
 
201
- analyticsStorage.setDefaultLogger(log);
201
+ if (typeof analyticsStorage.setDefaultLogger === 'function') {
202
+ analyticsStorage.setDefaultLogger(log);
203
+ }
202
204
 
203
205
  const { onInteraction, onEvent } = onInteractionHandler({
204
206
  log,
@@ -221,7 +223,7 @@ class BotApp {
221
223
  * @param {boolean} [nonInteractive]
222
224
  */
223
225
  async trackEvent (pageId, senderId, event, ts = Date.now(), nonInteractive = false) {
224
- const state = this._processor.stateStorage.getState(senderId, pageId);
226
+ const state = await this._processor.stateStorage.getState(senderId, pageId);
225
227
 
226
228
  if (!state) {
227
229
  throw new Error(`State ${pageId}:${senderId} not found. Ensure the #trackEvent() method was called after the conversation has started`);