Conversation
🦋 Changeset detectedLatest commit: 8fdcd04 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 |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThis PR introduces a debt repayment notification system using BullMQ queues. It adds a maturity queue for periodically checking user debts across 24h and 1h windows, processing accounts in batches, selecting between market and previewer implementations, and triggering push notifications via Redis-based deduplication. Changes
Sequence DiagramsequenceDiagram
participant Scheduler as Scheduler
participant Queue as BullMQ Queue
participant Worker as Maturity Worker
participant DB as Database
participant Contract as Contract (Market/Previewer)
participant Redis as Redis
participant Sentry as Sentry
participant Push as Push Notifications
Scheduler->>Queue: scheduleMaturityChecks() creates<br/>CHECK_DEBTS jobs (24h, 1h)
Queue->>Worker: Job available
Worker->>DB: Read accounts in batch (250)
Worker->>Contract: Query debt status<br/>(implementation-dependent)
Contract->>Worker: Debt results per user
Worker->>Redis: Check notification<br/>idempotency key
alt Debt exists & not notified
Worker->>Redis: Write idempotency key
Worker->>Push: Send push notification
end
Worker->>Sentry: Log metrics & breadcrumbs<br/>(contract calls, errors, results)
alt Window is "1h"
Worker->>Queue: Schedule next maturity checks<br/>(increment maturity)
end
Worker->>Queue: Mark job complete
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
Summary of ChangesHello @aguxez, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a critical new feature to proactively notify users about their upcoming debt maturities. It establishes a robust server-side queueing system using BullMQ to periodically check user debt positions on the blockchain. Depending on configuration, it leverages either direct market contract interactions or a previewer contract to identify at-risk users. Timely push notifications are then dispatched via OneSignal, with Redis ensuring that users receive alerts only once per window, aiming to help users manage their debts and avoid potential liquidations. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #722 +/- ##
==========================================
+ Coverage 72.21% 72.70% +0.49%
==========================================
Files 227 228 +1
Lines 8388 8552 +164
Branches 2699 2757 +58
==========================================
+ Hits 6057 6218 +161
- Misses 2109 2112 +3
Partials 222 222
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:
|
6550d21 to
45be58c
Compare
45be58c to
06f8efd
Compare
06f8efd to
ef1ce32
Compare
ef1ce32 to
26e6a32
Compare
26e6a32 to
2105108
Compare
2105108 to
b229c65
Compare
b229c65 to
e267d55
Compare
e267d55 to
fed4d42
Compare
fed4d42 to
1ed3cb9
Compare
4bce409 to
a5d5c22
Compare
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
⚠️ 1 issue in files not directly in the diff
⚠️ Missing positionAmount === 0n guard causes potential BigInt division-by-zero crash (src/components/pay/Pay.tsx:93-94)
The allMaturities computation in Pay.tsx does not filter out positions where positionAmount === 0n (line 94), unlike the sibling components OverduePayments.tsx:51 and UpcomingPayments.tsx:50 which both have explicit if (positionAmount === 0n) continue; guards. This accumulated value flows into FirstMaturityCard at src/components/pay/Pay.tsx:366 where (previewValue * WAD) / positionAmount would throw a BigInt division-by-zero error, crashing the Payments screen.
View 6 additional findings in Devin Review.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dccde14c19
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
server/utils/maturity.ts
Outdated
| callsPerAccount: totalAccountsProcessed > 0 ? totalContractCalls / totalAccountsProcessed : 0, | ||
| }, | ||
| }); | ||
| if (totalRpcFailures > 0 && totalRpcFailures >= totalAccountsProcessed / 2) { |
There was a problem hiding this comment.
Fail and retry when any account read is rejected
The new threshold gate only throws when totalRpcFailures >= totalAccountsProcessed / 2, which means partial RPC outages still complete the job successfully while silently dropping affected accounts from notification delivery. In a common case (e.g., 1–2 transient readContract failures in a larger batch), those users never get retried for this one-time reminder window, so notifications are permanently missed even though BullMQ retries are configured.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95157734d5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8fdcd04d52
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
closes #337
Summary by CodeRabbit
Release Notes