Repository navigation
fix(bot): honor nested capture and WELCOME fallbacks - #1293
Merged
Merged
Conversation
Unit B split from #1281, the behaviour changes that are unrelated to Redis: - handleMsg: when a nested flow has no match and the previous message asked for capture, process it as free capture instead of falling through to global keywords; WELCOME is evaluated last, only when no event keyword matched. - handleMsg: guard the capture branch on a non-empty match and tolerate a missing refToContinue ref. - addAnswer: derive the step ref deterministically from the parent ref so the same node keeps a stable callback key. - interactive: BUILDERBOT_SILENT env flag to silence printer output. - generator: normalize CRLF before rewriting starter entry points.
1 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Que tipo de Pull Request es?
Descripción
The behaviour changes that were bundled into #1281, split out after the Redis feature already landed in #1292.
Unit A (Redis adapter + persistent state) is merged as
09638c12. This is unit B, which no longer touches Redis at all.Cambios
packages/bot/src/core/coreClass.tscapturenow processes as free capture instead of falling through to global keywords; the capture branch guards on a non-empty match and tolerates a missingrefToContinueref;WELCOMEis evaluated last, only when no event keyword matchedpackages/bot/src/io/methods/addAnswer.tsrefderived deterministically from the parent ref, so repeated.addAnswer()on the same node keeps one stable callback key instead of a randomans_<uuid>packages/bot/src/utils/interactive.tsBUILDERBOT_SILENTenv flag silencesprinteroutputscripts/generate/index.tspackages/bot/__tests__/**0.2.5-handlemsg-fallbackssuite (4 cases) plus updatedcoreClass,eventsand0.0.1-flow-eventsexpectationsComportamiento que cambia
WELCOMEse asignaba al entrar al bloque de eventos y cualquier evento podía sobrescribirlo; ahora solo se usa si ningún keyword coincidió. Un bot que dependía de queWELCOMErespondiera además de un evento ya no duplicará respuesta.addAnswer: pasan a ser deterministas (<ref>A). Antes cada.addAnswer()generaba unans_<uuid>; dos.addAnswer()sobre el mismo nodo ahora compartenref, así que el último callback registrado es el que gana.BUILDERBOT_SILENTsolo cambia salida por consola.Verificación ejecutada
packages/botsuite completapackages/botunits0.2.5-handlemsg-fallbacks+0.0.1-flow-eventspnpm run generate:check@builderbot/botbuildFuera de alcance
Redis, el contrato async
BotState, la zona Redis y los starters: todo eso ya está mergeado en #1292. No hay cambios de dependencias ni de lockfile en este PR.Checklist
generate:checkexecuted on this tree