🐛 Fixed expired complimentary members not updating timestamps#28399
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR modifies the comped product cleanup job to record a timestamp alongside the member status update. When expired comped members are transitioned to 🚥 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ghost/core/test/integration/services/members/clean-expired-comped.test.js`:
- Around line 63-65: The query retrieving the status event is non-deterministic
because it only filters by member_id; update the
db.knex('members_status_events') lookup in the test to explicitly filter for the
comped→free transition (e.g., status_from = 'comped' and status_to = 'free') and
add a deterministic ordering (e.g., orderBy('created_at', 'desc')) before
calling .first() so the test always picks the intended transition event.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: cd40d0ad-b85f-4aa4-9885-7d15d7347f64
📒 Files selected for processing (2)
ghost/core/core/server/services/members/jobs/clean-expired-comped.jsghost/core/test/integration/services/members/clean-expired-comped.test.js
eda185b to
1209593
Compare
Expired complimentary tier cleanup updates members directly through knex, which skipped the model timestamp lifecycle and left integrations unable to poll for the transition.
1209593 to
05c74e8
Compare
Summary
Testing