-
Notifications
You must be signed in to change notification settings - Fork 0
Code Review Bench PR #25465 - Changed member welcome email job to run based on config #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: base_pr_25465_20260125_1161
Are you sure you want to change the base?
Changes from all commits
120efae
2ac7b59
3fedc84
f2429b3
bc7e716
bde2541
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ const ObjectId = require('bson-objectid').default; | |||||
| const {NotFoundError} = require('@tryghost/errors'); | ||||||
| const validator = require('@tryghost/validator'); | ||||||
| const crypto = require('crypto'); | ||||||
| const config = require('../../../../../shared/config'); | ||||||
|
|
||||||
| const messages = { | ||||||
| noStripeConnection: 'Cannot {action} without a Stripe Connection', | ||||||
|
|
@@ -336,8 +337,9 @@ module.exports = class MemberRepository { | |||||
| const eventData = _.pick(data, ['created_at']); | ||||||
|
|
||||||
| const memberAddOptions = {...(options || {}), withRelated}; | ||||||
| let member; | ||||||
| if (this._labsService.isSet('welcomeEmails') && WELCOME_EMAIL_SOURCES.includes(source)) { | ||||||
| var member; | ||||||
| const welcomeEmailConfig = config.get('memberWelcomeEmailTestInbox'); | ||||||
| if (welcomeEmailConfig || WELCOME_EMAIL_SOURCES.includes(source)) { | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 Bug:
|
||||||
| if (welcomeEmailConfig || WELCOME_EMAIL_SOURCES.includes(source)) { | |
| if (welcomeEmailConfig && WELCOME_EMAIL_SOURCES.includes(source)) { |
- Apply suggested fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚨 Bug: Inverted guard condition prevents job from ever being scheduled
The negation operator
!was removed from thehasScheduled.processOutboxcheck during the refactor. The original code was:The new code is:
Since
hasScheduled.processOutboxis initialized tofalse, the conditionhasScheduled.processOutbox && ...will always befalseon the first call, sojobsService.addJob()is never invoked andhasScheduled.processOutboxis never set totrue. The welcome email cron job will never be scheduled, making the entire feature non-functional in production.This is a regression — the
!must be restored.Was this helpful? React with 👍 / 👎