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

fix(hooks): send events to core on bot mount and unmount #322

Merged

Conversation

laurentlp
Copy link
Contributor

This PR fixes an issue where unmounting or mounting a bot using the bot config page would not trigger after_bot_mount and after_bot_unmount hooks. The reason was that the core was never aware of this change. To fix the issue, we simply send an internal call to the core telling it to unmount/mount a certain bot.

Closes botpress/v12#1618

Related to:

@linear
Copy link

linear bot commented Mar 24, 2022

DEV-2420 [BUG] on bot mount hook are only executed on server restart (botpress/botpress botpress/v12#1618)

Describe the bug
on bot mount hook are not executed if we remount a hook and only on server restart

To Reproduce
Create an on bot mount hook
unmount and remount your bot
You will see that the hook won't be executed

Restart the server and the hook will be executed

botpress/borpress botpress/v12#1618 by @ sebburon

@laurentlp laurentlp merged commit fbb4f61 into master Mar 28, 2022
@laurentlp laurentlp deleted the laurentlp-dev-2420-bug-on-bot-mount-hook-are-only-executed branch March 28, 2022 17:51
samuelmasse added a commit that referenced this pull request Apr 22, 2022
* feature(studio-ui): deploy chatbot button (#299)

* merge next

* first version deploy cloud btn

* polish button, better exp

* env var for link

* i18n

* ui bug changes

* spelling errors

Co-authored-by: Laurent Leclerc Poulin <laurentlp@users.noreply.github.com>

* Spelling Errors

Co-authored-by: Laurent Leclerc Poulin <laurentlp@users.noreply.github.com>

* Fr Spelling Mistake

Co-authored-by: Laurent Leclerc Poulin <laurentlp@users.noreply.github.com>

* Fr Spelling Mistake

Co-authored-by: Laurent Leclerc Poulin <laurentlp@users.noreply.github.com>

* todo move hardcoded value

* FR Change wording

* refactor functions

* refactor, more error codes

* eslint

* ignore libraries node modules

Co-authored-by: Laurent Leclerc Poulin <laurentlp@users.noreply.github.com>
Co-authored-by: allardy <yann.allard1@gmail.com>

* fix(studio): remove skill unusable on cloud (#316)

* feat(studio): allow disabling file listeners for read-only deployments (#242)

* fix(code-editor): minor ux fixes (#313)

* chore(studio-be): add route to invalidate cms cache for bot (#318)

* fix(code-editor): slight adjustment (#319)

* chore(server): v0.0.49 (#320)

* chore(inspector-kit): migrate superinput package to inspector-kit (#309)

* chore(inspector-kit): change file structure

* chore(inspector-kit): switch to scss modules

* feat(inspector-kit): finish setup; stub provider

* chore(inspector-kit): add storybook (#314)

* chore(inspector-kit): change file structure

* chore(inspector-kit): switch to scss modules

* chore(inspector-kit): add storybook

* fix(ts): wrong types for react-router-dom

* Implement text field as standalone (#315)

* chore(inspector-kit): change file structure

* chore(inspector-kit): add storybook

* chore(inspector-kit): add input; component and stories

* chore(inspector-kit): inherit from bp3 input; support leftIcon, rightElement

* Bootstrap inspector-kit tests (#321)

* feat(inspector-kit): add RTL

* chore(superinput): add tests

* chore(inspector-kit): update readme

* chore(migration): migration for srv_channels (#324)

* chore(migration): migration for srv_channels

* v0.0.50

* bump

* down migrate

* update mig

* fix typo

* fix(hooks): send events to core on bot mount and unmount (#322)

* update botpress.d.ts

* fix(actions): removed tooltip with doc of deprecated api (#326)

* feat(studio): add download modelweights step before uploading chatbot to cloud (#325)

* feat(studio): add download modelweights step before uploading chatbot to cloud

* removed typo

* pr comment

* fix(actions): fix number of conversations action (#328)

* chore(core): use proper env var for controller endpoint (#329)

* fix(dev): local cdm setup (#330)

* fix(dev): local cdm setup

* fix

* chore(dev): cloud local

* fix(debugger): do not escape user input in debugger logs (#327)

* fix(scope): call oauth with nlu scope (#334)

* chore(server): release v0.0.51 (#335)

* fix(code-editor): allow creating hooks with hook type as name (#333)

* feat(deploy): deploy to cloud btn should show failure toaster if runtime not ready (#336)

* feat(deploy): deploy to cloud btn should show failure toaster if runtime not ready

* chore(translations): add translations fr-en and point to those

* chore(es): add es translation

* feat(testing): added testing module to studio (#331)

* add missing translation

* fix(ui): toggle explorer (#338)

Co-authored-by: Laurent Leclerc-Poulin <laurentleclercpoulin@gmail.com>

* fix(cloud): cloud router error handling (#339)

* fix(cloud-service): error handling

* fix(ui): better handle push to cloud error codes

* Update packages/studio-be/src/studio/cloud/cloud-router.ts

Co-authored-by: Laurent Leclerc Poulin <laurentlp@users.noreply.github.com>

* Update packages/studio-be/src/studio/cloud/cloud-router.ts

Co-authored-by: Laurent Leclerc Poulin <laurentlp@users.noreply.github.com>

* Update packages/studio-be/src/studio/cloud/cloud-router.ts

Co-authored-by: Laurent Leclerc Poulin <laurentlp@users.noreply.github.com>

* custom error handling

* remove libraries feom sidebar

Co-authored-by: Laurent Leclerc Poulin <laurentlp@users.noreply.github.com>

* chore: remove libraries module (#342)

* wtf

* yarn

* fix

* fixes

Co-authored-by: Nick B <boutboulnicholas@gmail.com>
Co-authored-by: Laurent Leclerc Poulin <laurentlp@users.noreply.github.com>
Co-authored-by: allardy <yann.allard1@gmail.com>
Co-authored-by: Yann Allard <42552874+allardy@users.noreply.github.com>
Co-authored-by: David Vitor Antonio <david.vitora@gmail.com>
Co-authored-by: Laurent Leclerc-Poulin <laurentleclercpoulin@gmail.com>
Co-authored-by: Rob Gordon <rchristopher.gordon@gmail.com>
Co-authored-by: Thomas Caissie <30733005+tomkcey@users.noreply.github.com>
Co-authored-by: Francois-Xavier P. Darveau <955524+EFF@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] on bot mount hook are only executed on server restart
2 participants