You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
(node:97694) UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
at JSON.stringify (<anonymous>)
at Object.calculateChangeHash (/Users/etienne/Code/botkit-example/node_modules/botbuilder-core/lib/storage.js:29:17)
at BotkitConversationState.saveChanges (/Users/etienne/Code/botkit-example/node_modules/botbuilder-core/lib/botState.js:89:59)
at Botkit.<anonymous> (/Users/etienne/Code/botkit-example/node_modules/botkit/lib/core.js:507:42)
at Generator.next (<anonymous>)
at /Users/etienne/Code/botkit-example/node_modules/botkit/lib/core.js:7:71
at new Promise (<anonymous>)
at __awaiter (/Users/etienne/Code/botkit-example/node_modules/botkit/lib/core.js:3:12)
at Botkit.saveState (/Users/etienne/Code/botkit-example/node_modules/botkit/lib/core.js:506:16)
at Botkit.<anonymous> (/Users/etienne/Code/botkit-example/node_modules/botkit/lib/core.js:491:44)
What did you expect?
Repeat the previous message
Context:
Botkit version: 4.5.0
Messaging Platform: Web
Node version: 10.16.3
Os: MacOS
Inspecting the execution shows that in BotState.saveChanges the cached instance has a circular reference on the "first" value pointing to the "values" object, bot should contain the value of the answer given.
The text was updated successfully, but these errors were encountered:
When convo.repeat() is used, the BotkitConversation.onStep() method is called twice, the second time the step.result contains the whole step.values object. In the onStep method line 586 to 590, the result is captured into the step.values for the previous step; that's when things go wrong.
So I was looking at those calls in conversation.ts:
// did we just change threads? if so, restart this turn
if (index !== step.index || thread_name !== step.thread) {
return await this.runStep(dc, step.index, step.thread, DialogReason.nextCalled, step.values);
}
I don't understand why the step.values is passed as the result parameter here. The onStep method seems to expect the result from the last interaction. That's as far as I could go today!
Are you sure this is an issue with the Botkit core module?
Yes
What are you trying to achieve or the steps to reproduce?
I am trying to repeat a step in a conversation. However, if a question was asked before, the
repeat()
method will cause a crash.Reproduction steps:
convo.repeat()
and crashWhat was the result you received?
Error:
What did you expect?
Repeat the previous message
Context:
Inspecting the execution shows that in BotState.saveChanges the cached instance has a circular reference on the "first" value pointing to the "values" object, bot should contain the value of the answer given.
The text was updated successfully, but these errors were encountered: