Changed member welcome email job to run based on config#8
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| } | ||
|
|
||
| if (!hasScheduled.processOutbox && !process.env.NODE_ENV.startsWith('test')) { | ||
| if (hasScheduled.processOutbox && !process.env.NODE_ENV.startsWith('test')) { |
There was a problem hiding this comment.
Inverted condition prevents job from ever scheduling
High Severity
The condition hasScheduled.processOutbox was changed from !hasScheduled.processOutbox, causing the job to never be scheduled. Since hasScheduled.processOutbox starts as false, the condition is never true, so the code block that calls jobsService.addJob() and sets hasScheduled.processOutbox = true is never executed. The welcome email processing job will never run.
| 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.
Wrong operator breaks source filtering for outbox entries
High Severity
The condition changed from && to ||, breaking the source filtering logic. The original required both the config to be set AND the source to be in WELCOME_EMAIL_SOURCES. Now, if welcomeEmailConfig is truthy, outbox entries are created for ALL sources (import, admin, API), ignoring the source filter. This contradicts the test expectations that disallowed sources should not create outbox entries.
Benchmark PR from agentic-review-benchmarks#6
Note
Moves member welcome emails behind config rather than labs and updates behavior accordingly.
labs.isSet('welcomeEmails')withconfig.get('memberWelcomeEmailTestInbox')across welcome email job andMemberRepository.createMemberRepository.createnow enqueuesMemberCreatedEventoutbox when config is set (and for member-origin signups), including atimestampand passing transaction contextconfigUtils/config.getand validate outbox creation conditions and payloadprocess-member-welcome-emailscron jobWritten by Cursor Bugbot for commit bde2541. Configure here.