Skip to content

Behavior change for bot.recall('not yet stored key')? #13

@jpjpjp

Description

@jpjpjp

Did the update of the new storage/redis module change the overall behavior of storage?

This is sample code from Hotel California:

var htc = bot.recall('htc');
 // if htc has not been initialized to bot memory...
  if(!htc) {
    htc = bot.store('htc', {});
    // store default value
    htc.enabled = false;
  }

I have similar code to this in my bot, but since doing an npm update, I'm now getting a non-null value returned when the key has never been set. Rather it returns an unhandled error object. I also see:

Potentially unhandled rejection [1] Error: bot.recall() could not find the value referenced by id/key
at Object.recall (/Users/jshipher/Dropbox/dev/node/tropo-jira-notification-bot/node_modules/node-flint/storage/memory.js:60:32)

I can handle this in my code, but wondered if this behavior is planned/expected.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions