Repository navigation
release: 1.5.2 with queue.serializeByContact - #1300
Merged
Merged
Conversation
… contact Two messages from the same contact were handled concurrently. They share state, history and queue, so a gotoFlow, endFlow or fallBack of one turn could cancel the pending answers of the other, and continueFlow could resume from the other turn's step. The new opt-in option chains the turns of a contact (FIFO, O(1) per message). A turn is released when it settles or after queue.timeout counted from its start, its rejection is not swallowed, and other contacts keep running in parallel. Default is false: the listener only checks the flag and calls handleMsg as before. Design, measurements, limits and rollback: docs/rfc/0005-bot-serialize-turns-by-contact.md Co-authored-by: Cursor <cursoragent@cursor.com>
…tact feat(bot): add queue.serializeByContact to run one turn at a time per contact
Fix security advisory by overriding handlebars to ^4.7.10
With the state in Redis every read and write is async, so two overlapping turns of one contact read the same value and one write is lost. The new cases show the lost write without serializeByContact and that each turn sees the previous one with it. stop() must also detach the serialized listener so no turn opens after the bot stops. Co-authored-by: Cursor <cursoragent@cursor.com>
lerna 9 rejects --access, so lerna publish failed and only the per-package retry published 1.5.1. Access now comes from NPM_CONFIG_ACCESS. The final check waited 30s per package and failed while database-redis was still propagating, which skipped the tag and the GitHub release; it now waits ~3 min. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Why
queue.serializeByContact(#1283) was merged intobuilderbot-devafterv1.5.1was cut, so 1.5.1 on npm does not have it. A runtime that sets the option on 1.5.1 fails to compile and, without it, two messages of the same contact run concurrently again: answers are lost or repeated.This PR brings the feature to
builderbotso the next stable release (1.5.2) includes it.Changes
feat(bot):queue.serializeByContact— one turn at a time per contact (already reviewed in feat(bot): add queue.serializeByContact to run one turn at a time per contact #1283, RFCdocs/rfc/0005-bot-serialize-turns-by-contact.md). Defaultfalse, no change for bots that do not set it.test(bot): three new cases in0.2.5-serialize-by-contact.test.ts:serializeByContact, each turn sees the previous write;stop()detaches the serialized listener.The Redis case fails if the serialization is removed from
coreClass.ci(release):release-latest.ymlno longer passes--accessto lerna 9 (it madelerna publishfail in every 1.5.1 run) and waits ~3 min for npm before declaring a package missing (database-redis was published but not yet visible, which skipped the tag and the GitHub release).Verification
packages/bot: 243 tests pass on the base; serialize suite 11/11 with the new cases.After merge: run 🚀 (LATEST) Publicar release estable with
bump=patch(dry run first) to publish 1.5.2.Made with Cursor