Skip to content

Started waiting for member insertion before triggering automation#28376

Open
EvanHahn wants to merge 1 commit into
mainfrom
trigger-member-signup-in-separate-transaction
Open

Started waiting for member insertion before triggering automation#28376
EvanHahn wants to merge 1 commit into
mainfrom
trigger-member-signup-in-separate-transaction

Conversation

@EvanHahn
Copy link
Copy Markdown
Contributor

@EvanHahn EvanHahn commented Jun 4, 2026

towards https://linear.app/ghost/issue/NY-1286
ref #28120

I recommend reviewing this with whitespace changes disabled.

What: We want to trigger automations after members are inserted.

Why: If we don't do this, automations could run before the member exists in the database.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 4, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0af9f6ec-a60d-46d0-9d2f-7f2245a242a4

📥 Commits

Reviewing files that changed from the base of the PR and between 7e7e1ee and e04da95.

📒 Files selected for processing (1)
  • ghost/core/core/server/services/members/members-api/repositories/member-repository.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • ghost/core/core/server/services/members/members-api/repositories/member-repository.js

Walkthrough

The PR updates member signup automation triggering to be transaction-aware. The private helper #triggerMemberSignupAutomation now accepts bookshelfOptions; if a Bookshelf transaction is present it defers calling automationsApi.trigger('member_sign_up') until transacting.executionPromise resolves and logs any errors, otherwise it triggers and awaits immediately. The public triggerMemberSignupAutomation now forwards bookshelfOptions into the private helper.

Possibly related PRs

Suggested labels

ok to merge for me

Suggested reviewers

  • troyciesco
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: deferring automation triggering until after member insertion completes within a transaction context.
Description check ✅ Passed The description clearly relates to the changeset by explaining the motivation (prevent automations running before member exists) and the solution approach (wait for member insertion).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch trigger-member-signup-in-separate-transaction

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

@EvanHahn EvanHahn force-pushed the trigger-member-signup-in-separate-transaction branch from 5c79614 to 7e7e1ee Compare June 4, 2026 19:44
@EvanHahn EvanHahn requested a review from troyciesco June 4, 2026 19:44
@EvanHahn EvanHahn marked this pull request as draft June 4, 2026 21:09
towards https://linear.app/ghost/issue/NY-1286
ref #28120

*I recommend reviewing this with whitespace changes disabled.*

**What:** We want to trigger automations after members are inserted.

**Why:** If we don't do this, automations could run before the member
exists in the database.
@EvanHahn EvanHahn force-pushed the trigger-member-signup-in-separate-transaction branch from 7e7e1ee to e04da95 Compare June 4, 2026 21:26
@EvanHahn EvanHahn marked this pull request as ready for review June 4, 2026 21:26
@EvanHahn EvanHahn requested review from cmraible and removed request for troyciesco June 4, 2026 21:36
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.

1 participant