The #3136 invite notification never ran: its params object was declared
inside the email block, so Notifications.notify() threw a ReferenceError
that its own catch logged. With it in scope, the tray would still have
refused an entry with no activity, and the email service would have queued
a second email beside the invitation. The invite now delivers the
membership's addBoardMember activity, which the bell already renders, to an
existing invitee's tray only, honouring their tray setting. A re-activated
membership records that activity; re-inviting an active member adds nobody.
Refs #3136.
Thanks to CondensedTea and xet7 !
Eighteen suites had been failing because the code they read had changed on
purpose: notification delivery moved to stored plans, exports gained the
admin-only field guard and Scrum transfer, board copy became selectable,
card copy re-keys filtered custom fields, the Scrum settings menu entry was
added, new operator-only scripts, directory-login canaries, a rate-limit rule
that made the first mention of undoLast no longer the method, rule parts and
Sync-scoped recording in hooks evaluated by test harnesses, per-board card
dragging, and a Dependabot file-type bump. Each guard now pins the new
behaviour with a comment naming the change, keeps its original assertions,
and several gained positive and negative cases (export field guard, copy
defaults, Sync-scoped recording, card dragging, method lookup).
Two list-sync browser specs logged a second context in with the same
session token; they now get their own tokens, and the token guard counts
distinct pages instead of logins.
Thanks to xet7 !
#3136: Users.inviteUserToBoard (server/models/users.js) only ever sent an
invitation email. Board membership/watcher changes already fan out through
Notifications.notify(user, title, description, params) - the same helper
server/models/activities.js calls for card assignment, due dates, mentions
and every other activity-driven notification, reaching both the email
service and the in-app notification bell - but an invite itself never went
through it.
inviteUserToBoard now also calls Notifications.notify(user, 'push-invite-title',
'push-invite-text', params) with the same params object built for the
invitation email, right after the email is sent. It is guarded by
`!isNewUser`: a brand-new invitee created from an email address with no
matching WeKan account has no established notification target yet, so they
stay email-only, exactly as before, with no error. The push call has its own
try/catch so a failing notification service can never break the invite.
Added push-invite-title/push-invite-text to en.i18n.json and every other
locale file, reusing each locale's own already-translated
email-invite-subject/email-invite-text wording (the only existing invite
wording to draw a style from), so every locale ships a real translation
immediately - no English placeholders except the en-* regional variants,
which are English by design.
Added tests/boardInvitePushNotification.test.cjs: a source-inspection
regression test (inviteUserToBoard is a full Meteor method and cannot run
outside a Meteor server) pinning that the fix reuses the exact
Notifications.notify(user, title, description, params) helper/signature
already used elsewhere - exactly one call site, not a second
implementation - guarded by `if (!isNewUser)`, wrapped in its own try/catch,
with the email send left unconditional, and that every locale file carries
the two new keys with the same placeholder tokens as their email
counterparts.
Thanks to CondensedTea and xet7 !
Closes#3136,