Riddy21 / Riddy21/Friday_Budgeting_Pro
feat: deduplicate joint/shared accounts across bank connections
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Problem
When a user has joint accounts that appear in multiple bank connections (e.g. a shared chequing account visible from both a personal BMO connection and a joint RBC connection), Friday currently:
- Shows the same account twice on the accounts page
- Pulls and stores transactions from both connections, double-counting everything
- Doubles the displayed balance
Solution
Detect duplicate accounts across connections and designate one as primary. Only the primary account syncs transactions and appears in the UI.
Deduplication key
Two bank_accounts rows are duplicates when they share the same:
mask(last 4 digits, when available)name(account name)type+subtype(e.g. depository/checking)
Implementation
DB
ALTER TABLE bank_accounts ADD COLUMN is_duplicate INTEGER NOT NULL DEFAULT 0;
ALTER TABLE bank_accounts ADD COLUMN primary_account_id TEXT REFERENCES bank_accounts(id);
Sync (server/main.py)
After upserting account rows in sync(), run a deduplication pass:
- Group
bank_accountsby(mask, name, type, subtype)wheremask IS NOT NULL - For groups with >1 row: keep the row with the earliest
id(or most recent sync) as primary, mark othersis_duplicate=1, primary_account_id=<primary> - Skip transaction sync for
is_duplicate=1accounts
UI (ui/server.py + accounts.html)
- Filter out
is_duplicate=1accounts from the accounts page display - Show a small note on the primary account if duplicates were detected: "Also connected via [institution]"
MCP list()
- Exclude duplicate accounts from transaction queries by default
- Add optional
include_duplicates=Trueparam for power users
Acceptance criteria
- Same account connected via two banks → only shown once in UI
- Transactions only pulled from primary account
- Balance shown once, not doubled
- Unit tests for deduplication logic
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace the sync() flow in server/main.py and inspect how bank_accounts schema changes are handled. Then follow account queries in ui/server.py, accounts.html, and MCP list(), including existing tests around synchronization. Done means duplicate accounts are consolidated across sync, UI, transaction queries, balances, and the requested deduplication tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sql
- Domain
- backend, database, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100