a91855993 routed member usernames through ruleUsernames() and the email
recipient through recipientVars(). ruleEmailFailure runs RulesHelper in a
VM with each free name injected, so the missing recipientVars made the
email path throw and the test wait forever; it now injects an identity
recipientVars. Two guards pinned the literal
getUser({ username: action.username }) line; a literal username is still
looked up unchanged, so they now pin the per-username lookup and keep
their defensive-resolution and crash-pattern assertions.
Thanks to xet7 !
The "add member" rule action's acting-user option (issue #2522 - "add
whoever just moved the card as a member") landed on main missing its
shared module: server/rulesHelper.js and cardActions.js already import
RULE_ACTING_USER_SENTINEL/resolveActingUserId from
/models/lib/ruleActingUser, but that file was never committed, breaking
the import on main. It also landed without the actual UI button that
saves the sentinel action.
models/lib/ruleActingUser.js resolves "who triggered this rule" from
activity.userId - the exact same source buildRuleVars() already uses for
the {username} template variable (#3304/#3301) - so both call one shared
function instead of two implementations of the same concept.
cardActions.jade gets the missing trigger button, wired to the existing
js-add-actinguser-member-action handler in cardActions.js.
tests/ruleAddMemberActingUser.test.cjs pins the sentinel resolution, that
rulesHelper.js and buildRuleVars() both call the one shared resolver (with
a negative, whole-tree source-pattern check that no other file
re-implements the same activity.userId shape), that the ordinary
fixed-member path is unaffected, the client/jade wiring, and that every
locale file has a real (non-English-placeholder) translation of the new
label. tests/ruleRemoveMemberAction.test.cjs and
tests/rulesApiTriggerNormalize.test.cjs are updated for the addMember
block's new if/else shape around the sentinel check.
Thanks to arisjr and xet7 !
Closes#2522,