🐛 server: fix repeat options on maturity queue - #1182
Conversation
🦋 Changeset detectedLatest commit: e020098 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Review limit reached
Next review available in: 45 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
WalkthroughMaturity reminder workers now process delayed jobs, notification TTLs clamp to zero for past maturities, and both schedulers use timestamp-aligned start dates. Tests verify delayed processing, notification behavior, scheduler timestamps, and direct scheduler upsert arguments. ChangesMaturity reminders
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
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
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: b81546a4-859a-4981-8f6f-4f5a572bf266
📒 Files selected for processing (2)
server/test/utils/maturity.test.tsserver/utils/maturity.ts
c69da84 to
bc3a972
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
server/utils/maturity.ts (1)
419-430: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winUse future maturity-window start dates.
Both sites encode start dates that are already past, causing BullMQ to schedule the initial job immediately rather than at the intended maturity boundary. (raw.githubusercontent.com)
server/utils/maturity.ts#L419-L430: remove- everyand derive eachstartDatefrommaturity * 1000 + offset.server/test/utils/maturity.test.ts#L302-L324: update both expectedstartDatevalues to match the corrected maturity-boundary calculation.Source: MCP tools
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: e22b165f-fb5e-4e3f-bd68-8037f49d387e
📒 Files selected for processing (3)
.changeset/long-carpets-cut.mdserver/test/utils/maturity.test.tsserver/utils/maturity.ts
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1182 +/- ##
==========================================
+ Coverage 70.69% 70.87% +0.18%
==========================================
Files 263 263
Lines 11446 11524 +78
Branches 3833 3854 +21
==========================================
+ Hits 8092 8168 +76
- Misses 3059 3060 +1
- Partials 295 296 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3297d808a
ℹ️ 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".
| @@ -119,15 +118,6 @@ const worker = observe( | |||
| case "check-debts": { | |||
| const check = parse(checkDebtsSchema, job.data); | |||
| const maturity = (Math.floor(Date.now() / 1000 / MATURITY_INTERVAL) + 1) * MATURITY_INTERVAL; | |||
There was a problem hiding this comment.
Preserve the scheduled maturity on delayed planner jobs
When a check-debts job is delayed across its maturity boundary, this recalculates maturity from the execution time rather than the scheduled occurrence. Since the stale-job guard was removed, a 24-hour planner resuming just after the original maturity now scans the next maturity and can send a “due in 24 hours” reminder nearly a full interval early. Include the intended maturity in the scheduled job data or reject planners that cross a maturity boundary.
Useful? React with 👍 / 👎.
Summary
startDatevalues for 24-hour and 1-hour maturity schedulers.Testing
Summary by CodeRabbit
ttlbased on the current time, avoiding incorrect suppression of delayed notifications.