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

Add userId param to widgetOpened event #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sasha-x
Copy link

@sasha-x sasha-x commented Sep 2, 2019

If I am trying to start conversation with user from widgetOpened event, like this:

//index.html
var botmanWidget = {
sendWidgetOpenedEvent: 1
}
//bot.php
$botman->hears('(.*)', function ($bot){
    $bot->startConversation(new WelcomeConversation());
});

I see in my cache conversation duplicates (and in UI too):

root@scw:~# redis-cli KEYS '*'
1) "botman:cache:conversation-da39a3ee5e6b4b0d3255bfef95601890afd80709-da39a3ee5e6b4b0d3255bfef95601890afd80709"
2) "botman:cache:conversation-0409cb8558ad20d53c230f23e83cc64e15b6fa70-0409cb8558ad20d53c230f23e83cc64e15b6fa70"

The first hash is constantly equals sha1("") . The reason is widgetOpened event, which raise first instance of conversation, has no binding to any user.

With my fix all seems to work ok.

@sasha-x
Copy link
Author

sasha-x commented Sep 9, 2019

@mpociot , could you plz pay some attention to PRs?
There are several other points which may become issues or PRs in main botman repo.

@EranGrin
Copy link

Great, I'll add it to here https://www.npmjs.com/package/botman-extended-web-widget

EranGrin added a commit to EranGrin/botman-extended-web-widget that referenced this pull request Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants