Skip to content

release: 1.5.2 with queue.serializeByContact - #1300

Merged
leifermendez merged 5 commits into
builderbotfrom
release/1.5.2-serialize-by-contact
Nov 18, 2026
Merged

leifermendez merged 5 commits into
builderbotfrom
release/1.5.2-serialize-by-contact

Conversation

@leifermendez

Copy link
Copy Markdown
Member

Why

queue.serializeByContact (#1283) was merged into builderbot-dev after v1.5.1 was 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 builderbot so 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, RFC docs/rfc/0005-bot-serialize-turns-by-contact.md). Default false, no change for bots that do not set it.
  • test(bot): three new cases in 0.2.5-serialize-by-contact.test.ts:
    • with the state in Redis and no serialization, two overlapping turns lose a write (documents the bug);
    • with Redis and 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.yml no longer passes --access to lerna 9 (it made lerna publish fail 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.
  • Mutation check: disabling the serialization makes the new Redis case and the 3 ordering cases fail.

After merge: run 🚀 (LATEST) Publicar release estable with bump=patch (dry run first) to publish 1.5.2.

Made with Cursor

leifermendez and others added 5 commits November 17, 2026 14:55
… 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>
@leifermendez
leifermendez merged commit 01f5fd1 into builderbot Nov 18, 2026
2 checks passed
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.

1 participant