Fix split - #36
Conversation
|
Warning Review limit reached
Next review available in: 1 minute 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: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThe transaction API now supports filtered JSON responses across all pages. Split-bill handlers consume supplied or fetched transactions, normalize data, and recalculate totals after transaction updates. Transaction-page category filtering now has split-total coverage. ChangesTransaction filtering and split-bill updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant FilterComponent
participant TransactionsAPI
participant Transactions
participant SplitBill
FilterComponent->>Transactions: dispatch transactionsUpdated after transaction-list refresh
Transactions->>SplitBill: emit splitBillUpdate with selected or summary data
SplitBill->>TransactionsAPI: request filtered transactions with json=true when details are absent
TransactionsAPI-->>SplitBill: return normalized amounts and tags
SplitBill->>SplitBill: calculate total and render transactions
Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 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: 3
🤖 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 `@JustAnotherExpenseManager/routes/transactions.py`:
- Around line 153-170: The JSON branch in the transaction route currently calls
get_all_transactions once per page, repeating filtered transaction and tag
queries. Add a service method that retrieves all transactions matching the
existing categories, tags, date, description, and amount filters in a single
query, then use that method in the json=true path and serialize its complete
result without iterating through result['total_pages'].
In `@static_src/js/split_bill.ts`:
- Around line 78-90: Preserve the summary event’s expense-card total in the
transaction-loading path instead of replacing it with the sum of all normalized
transactions, and filter loaded transactions to those represented by that
summary total. Apply this behavior in static_src/js/split_bill.ts at lines 78-90
and mirror it in JustAnotherExpenseManager/static/js/split_bill.js at lines
54-64. Update tests/11-split-bill.spec.ts at lines 199-224 to include an income
transaction and assert the filtered summary total remains expense-only.
- Around line 68-90: Prevent stale transaction fetches from overwriting newer
state in the splitBillUpdate listener: add request-order protection, preferably
by aborting the previous AbortController or tracking a latest-request revision
and ignoring outdated responses. Apply the equivalent fix in
static_src/js/split_bill.ts (lines 68-90) and
JustAnotherExpenseManager/static/js/split_bill.js (lines 44-64), preserving
updates from selected transaction events and only rendering results from the
current request.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: af822ed8-0e05-45a8-8b4f-a093ddaf45dd
📒 Files selected for processing (8)
JustAnotherExpenseManager/routes/transactions.pyJustAnotherExpenseManager/static/js/filter_component.jsJustAnotherExpenseManager/static/js/split_bill.jsJustAnotherExpenseManager/static/js/transactions.jsstatic_src/js/filter_component.tsstatic_src/js/split_bill.tsstatic_src/js/transactions.tstests/11-split-bill.spec.ts
Summary by CodeRabbit
New Features
Bug Fixes
Tests