Skip to content

Improved types for MemberRepository#dispatchEvent#27388

Merged
EvanHahn merged 1 commit intomainfrom
improve-types-for-member-repository-dispatch-event
Apr 14, 2026
Merged

Improved types for MemberRepository#dispatchEvent#27388
EvanHahn merged 1 commit intomainfrom
improve-types-for-member-repository-dispatch-event

Conversation

@EvanHahn
Copy link
Copy Markdown
Contributor

towards https://linear.app/ghost/issue/NY-1190
ref #27364

MemberRepository.prototype.dispatchEvent had no types. This adds them, and fixes a minor bug caused by the lack of types.

This should have no user impact, but makes an upcoming PR (see ref) a little smaller.

towards https://linear.app/ghost/issue/NY-1190
ref #27364

`MemberRepository.prototype.dispatchEvent` had no types. This adds them,
and fixes a minor bug caused by the lack of types.

This should have no user impact, but makes an upcoming PR (see ref) a
little smaller.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 14, 2026

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: 53a8cdc3-3d0f-4075-8b9b-a11ea8c30be4

📥 Commits

Reviewing files that changed from the base of the PR and between dd17126 and d9699c2.

📒 Files selected for processing (1)
  • ghost/core/core/server/services/members/members-api/repositories/member-repository.js

Walkthrough

This change updates the dispatchEvent method in the member repository. A JSDoc type annotation was added to clarify the expected event parameter type and the structure of options.transacting.executionPromise. The error logging for the transactional dispatch path was enhanced to conditionally include member identification in error messages. The logged error message was updated from direct property access to a guarded interpolation that safely checks if event.data is an object before accessing memberId, preventing potential undefined reference errors.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding type annotations to the MemberRepository#dispatchEvent method.
Description check ✅ Passed The description clearly explains the purpose of the PR: adding types to dispatchEvent, fixing a related bug, and references relevant issues and PRs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 improve-types-for-member-repository-dispatch-event

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.

@EvanHahn EvanHahn enabled auto-merge (squash) April 14, 2026 15:19
@sonarqubecloud
Copy link
Copy Markdown

@EvanHahn EvanHahn merged commit 7274de4 into main Apr 14, 2026
44 checks passed
@EvanHahn EvanHahn deleted the improve-types-for-member-repository-dispatch-event branch April 14, 2026 15:44
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