Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to reset remembered state if the typebot was updated #1508

Closed
baptisteArno opened this issue May 13, 2024 · 4 comments · Fixed by #1675
Closed

Option to reset remembered state if the typebot was updated #1508

baptisteArno opened this issue May 13, 2024 · 4 comments · Fixed by #1675
Labels
Improvement ⚡ Something that improves existing feature. Quick to implement.

Comments

@baptisteArno
Copy link
Owner

No description provided.

@baptisteArno baptisteArno added Improvement ⚡ Something that improves existing feature. Quick to implement. Quick win ⏩ labels May 13, 2024
@basuabhirup
Copy link
Contributor

basuabhirup commented Jul 26, 2024

I think this is related to #1427 and #1429 (already resolved) and related to the discussion in https://discord.com/channels/1155799591220953138/1225863426790789160

As far as I understood, the requirement is to display a prompt that says "Update typebot in existing sessions?" or something like that when the user attempts to publish new changes.

And when the user selects yes i.e. they want to reset the remembered chats , then all the existing end-user sessions will remove the data already stored in their localStorage and sessionStorage and will reload the newly published chatbot from beginning, right ?

@baptisteArno
Copy link
Owner Author

After thinking about it. I think it should be a default behavior. The startChat API endpoint should check for the updatedAt field on the published bot and if the chatSession is older, we would wipe the session saved in storage.

@basuabhirup
Copy link
Contributor

After thinking about it. I think it should be a default behavior. The startChat API endpoint should check for the updatedAt field on the published bot and if the chatSession is older, we would wipe the session saved in storage.

Yeah, that sounds good. So basically we will have to write a new prisma query to check if the updatedAt field of a particular published bot is older than the updatedAt field of the current chatSession and if not then it will execute wipeExistingChatStateInStorage() and behave similarly as if there is no chatState stored in the storage, right ?

@baptisteArno
Copy link
Owner Author

Yes, exactly 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement ⚡ Something that improves existing feature. Quick to implement.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants