Skip to content

Changed member welcome email job to run based on config#8

Open
tomerqodo wants to merge 6 commits intocursor_full_base_changed_member_welcome_email_job_to_run_based_on_config_pr6from
cursor_full_head_changed_member_welcome_email_job_to_run_based_on_config_pr6
Open

Changed member welcome email job to run based on config#8
tomerqodo wants to merge 6 commits intocursor_full_base_changed_member_welcome_email_job_to_run_based_on_config_pr6from
cursor_full_head_changed_member_welcome_email_job_to_run_based_on_config_pr6

Conversation

@tomerqodo
Copy link
Copy Markdown

@tomerqodo tomerqodo commented Jan 25, 2026

Benchmark PR from agentic-review-benchmarks#6


Note

Moves member welcome emails behind config rather than labs and updates behavior accordingly.

  • Replace labs.isSet('welcomeEmails') with config.get('memberWelcomeEmailTestInbox') across welcome email job and MemberRepository.create
  • MemberRepository.create now enqueues MemberCreatedEvent outbox when config is set (and for member-origin signups), including a timestamp and passing transaction context
  • Update integration/unit tests to use configUtils/config.get and validate outbox creation conditions and payload
  • Job scheduler now checks config before scheduling the process-member-welcome-emails cron job

Written by Cursor Bugbot for commit bde2541. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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')) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

if (this._labsService.isSet('welcomeEmails') && WELCOME_EMAIL_SOURCES.includes(source)) {
var member;
const welcomeEmailConfig = config.get('memberWelcomeEmailTestInbox');
if (welcomeEmailConfig || WELCOME_EMAIL_SOURCES.includes(source)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants