Added member activity entry when gift subscription ends#27649
Conversation
- when a gift subscription's validity period runs out and the member drops back to free, the admin member-activity feed now shows an "ended paid subscription" entry alongside the existing "redeemed gift" entry - backend reads from the existing members_status_events rows (gift→free), so no new write path or schema change is needed; the gift→paid case is intentionally excluded since it is already covered by "continued paid subscription after gift" - copy and icon match the paid-subscription "expired" event so the lifecycle reads consistently to publishers
WalkthroughAdds support for a new event type, 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29ec779df0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #27649 +/- ##
==========================================
+ Coverage 73.17% 73.20% +0.02%
==========================================
Files 1561 1561
Lines 127051 127116 +65
Branches 15383 15397 +14
==========================================
+ Hits 92970 93050 +80
+ Misses 33105 33087 -18
- Partials 976 979 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| 'data.created_at': 'created_at', | ||
| 'data.member_id': 'member_id' |
There was a problem hiding this comment.
Do we need this re-mapping if we are using the same named keys?
There was a problem hiding this comment.
Still needed to strip the data prefix (also what we do in getPaymentEvents, getLoginEvents, getNewsletterSubscriptionEvents, etc.)
| } | ||
|
|
||
| if (event.type === 'gift_ended_event') { | ||
| return 'ended paid subscription'; |
There was a problem hiding this comment.
This ok being the same as subscription_event.expired? I don't think we can end up with the same event twice right?

closes https://linear.app/ghost/issue/BER-3596
Summary
back to free, the admin member-activity feed now renders an "ended paid
subscription" entry
members_status_eventsrows(
from_status: gift, to_status: free), so no new write path or schemachange is needed
expiredevent so thelifecycle reads consistently to publishers
Test plan
cd ghost/core && pnpm test:single test/unit/server/services/members/members-api/repositories/event-repository.test.jsparse-member-eventconsumes_atin the past, runprocessConsumed()), confirm the member's activity feed shows "ended paid subscription" at the consume time