fix(transactions): include enable_banking in pending/confirmed status filter#1885
fix(transactions): include enable_banking in pending/confirmed status filter#1885web-dev0521 wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughCentralizes pending detection into Transaction::PENDING_CHECK_SQL and delegates status filtering to model scopes; updates EntrySearch to use the shared predicate and adds regression tests that verify pending/confirmed filtering across all providers. ChangesStatus Filter Refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 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 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 |
… filter (we-promise#1668) The transaction status filter hardcoded only simplefin/plaid/lunchflow in its pending/confirmed SQL, even though Transaction::PENDING_PROVIDERS also includes enable_banking. As a result, Enable Banking pending transactions returned 0 results under the "Pending" filter and leaked into "Confirmed". Source the provider list from the existing constant-driven helpers instead: - Transaction::Search delegates to the `pending` / `excluding_pending` model scopes. - EntrySearch interpolates Transaction::PENDING_CHECK_SQL into its EXISTS subqueries. This keeps every status-filter path in sync with PENDING_PROVIDERS so adding a future provider can't reintroduce the bug. Fixes we-promise#1668
1e0c28d to
bd7170d
Compare
|
Good fix and the right architectural direction — delegating to One thing to verify: Generated by Claude Code |
…ders Adds a regression test for the EntrySearch#apply_status_filter path, asserting pending transactions for every PENDING_PROVIDERS entry are matched by the "pending" filter and excluded from "confirmed". Mirrors the existing Transaction::Search coverage so both filter paths are exercised.
0935ff3 to
e8c6472
Compare
|
Hi, @jjmata , |
Summary
The transaction status filter (Pending / Confirmed) hardcoded only
simplefin,plaid, andlunchflowin its SQL, even thoughTransaction::PENDING_PROVIDERSalso includesenable_banking. As a result,for Enable Banking users:
enable_banking, so those transactions passed through.This is the same class of bug that was previously fixed for
lunchflowin #859.Fixes #1668.
Changes
Transaction::Search#apply_status_filternow delegates to the existingpending/excluding_pendingmodel scopes instead of hardcoded SQL.EntrySearch#apply_status_filternow interpolatesTransaction::PENDING_CHECK_SQL(already aliased tot) into itsEXISTSsubqueries.Transaction::PENDING_PROVIDERS, so adding a future provider can't silently reintroduce the bug.PENDING_PROVIDERSand asserts each is matched by "Pending" and excluded from "Confirmed".Test plan
bin/rails test test/models/transaction/search_test.rbSummary by CodeRabbit
Bug Fixes
Tests