feat(message): unify bulk template variables onto the shared {{name}} renderer (#69) - #411
Merged
Merged
Conversation
… renderer (#69) Bulk send (send-bulk) substituted messages[].variables with a single-brace {name} convention, inconsistent with the {{name}} used by message templates and everywhere else in the gateway. Route bulk content through the shared renderTemplate helper, extended to accept both conventions via ordered alternation: the double-brace branch is tried first, so {{name}} is consumed as a unit and the legacy single-brace branch can't mangle it to {value}. Existing {name} content renders bit-for-bit as before; {{name}} is now the canonical, documented form and {name} is deprecated.
…ariable-syntax # Conflicts: # CHANGELOG.md
Merged
CaldeDaniele
pushed a commit
to CaldeDaniele/OpenWA
that referenced
this pull request
Jun 22, 2026
* commit '61582a487ca0759b049df0f667e27eb7196b0d32': (244 commits) fix(hooks): emit the message:ack hook (declared but never fired) (rmyndharis#427) feat: plugin platform — sandboxed plugins + dashboard install/uninstall (v0.6.0) (rmyndharis#426) test(security): verify undici honors the SSRF connect.lookup pin (real connection) (rmyndharis#425) chore(deps-dev): bump @types/node from 25.9.3 to 26.0.0 (rmyndharis#423) chore(deps): bump undici from 6.27.0 to 8.5.0 (rmyndharis#422) chore(deps-dev): bump @types/node from 25.9.3 to 26.0.0 in /dashboard (rmyndharis#420) chore(deps): bump the minor-and-patch group in /dashboard with 3 updates (rmyndharis#419) chore(deps): bump the minor-and-patch group with 10 updates (rmyndharis#421) fix(dashboard): keep the appearance popover inside the sidebar (rmyndharis#424) test(e2e): isolate the auth/audit (main) DB too, so e2e api-keys don't pollute the dev DB (rmyndharis#418) docs(changelog): log the plugin action/state color fix under [Unreleased] fix(dashboard): distinguish plugin action buttons from passive state (rmyndharis#417) test(e2e): isolate the e2e data DB so suites don't pollute the dev database (rmyndharis#416) chore(release): v0.5.1 (rmyndharis#413) feat(plugins): enforce declared capability permissions at the boundary (rmyndharis#412) feat(message): unify bulk template variables onto the shared {{name}} renderer (rmyndharis#69) (rmyndharis#411) fix(session): ignore engine callbacks from a superseded or torn-down engine (rmyndharis#410) ci(release): block a mis-tagged or under-documented release at the gate (rmyndharis#408) fix(docs): source version badges + Swagger from package.json and guard drift in CI (rmyndharis#407) chore(release): v0.5.0 (rmyndharis#406) ... # Conflicts: # dashboard/Dockerfile # dashboard/Dockerfile.traefik
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.
Closes #69.
Problem
The gateway had two placeholder conventions for variable substitution:
send-template, stored templates) use double-brace{{name}}via the sharedrenderTemplatehelper.send-bulk,messages[].variables) used a separate single-brace{name}renderer insidebulk-message.service.ts.So the same idea — "substitute a variable" — needed different syntax depending on the endpoint, and
{{name}}in bulk content was silently mangled to{value}by the single-brace regex.Fix
Route bulk content through the shared
renderTemplate, extended to accept both conventions via one ordered-alternation regex:The double-brace branch is tried first at each position, so
{{name}}is consumed as a unit and the legacy single-brace branch never sees its interior (no{{name}}→{value}mangling). The legacy branch keeps the historical{name}shape exactly (word chars, no whitespace), so existing single-brace bulk content renders bit-for-bit as before.{{name}}is now the canonical form, consistent across the gateway and documented.{name}is deprecated but still substituted for backward compatibility.Tests
template-render.spec.ts: both syntaxes, mixed strings, the{{name}}-not-mangled disambiguation, missing-key-left-literal, whitespace, dotted/dashed keys, empty-string value, non-placeholder braces.{{name}}substitutes; legacy{name}still works.Notes
{{name}}+ a deprecation note onmessages[].variables.''(the old single-brace renderer treated''as "missing" and left the placeholder literal). The sharedhasOwnPropertysemantics are the more correct behavior.Full suite: 1096 passed / 96 suites; build + lint clean.