Repository navigation
Conversation
detectTransfers() (core.js) marked every pair and every keyword match as a transfer and set its categories to Transfer out / Transfer in, without looking at txOverrides. Every import (loadFiles()), keyword change (reapplyTransferKeywords()) and reload from browser storage (DB.loadAll()) runs it. So a ZELLE transfer set to Expense became a transfer again at the next keyword change, import or reload, and a category added to a detected transfer (Transfer out + Housing, or bulk Set category) was replaced at the next reload. Up to v1.16.15 the drawer stored the type with every save, which kept a saved transfer out of detection's way and hid the category half; a saved Expense or Income type was overridden all along. master has the same detectTransfers(). - A transaction whose edit has a type is left out of detection: it isn't marked and isn't paired. The leg it would have paired with is checked on its own: another pair, a keyword (one-sided), or as imported. - A transaction marked a transfer keeps the edit's categories (or an older single category); without them it still gets Transfer out / Transfer in. - No caller changed. Without edits the samples give the same 30 transfers and 12 pairs, every row the same. - Version bumped to v1.16.23 (CHANGELOG, footer, README, Settings, CLAUDE.md); CLAUDE.md §4.1 and §11, README Transfers updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
22 tasks
Draft
5 tasks
…to fix-transfer-detection-user-type Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Z8iBUZo6LRYpLthSp2PRi # Conflicts: # js/views-settings.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Transfer detection now respects your edit. A transaction whose type you set (Expense, Income / refund, Card payment, Transfer) keeps that type: detection doesn't mark it and doesn't pair it. Categories you set are kept when detection marks a transaction as a transfer.
Example: set a ZELLE TO M TORRES transfer to Expense. Before this fix it became a transfer again at the next keyword change, import or reload. Now it stays an expense.
Cause
detectTransfers()(core.js) ignoredtxOverrides. Both passes (pairs, then keywords) marked every match as a transfer and set its categories to Transfer out / Transfer in.loadFiles()(every import),reapplyTransferKeywords()(every keyword change) andDB.loadAll()(a reload from browser storage).detectTransfers()is the same code. A probe on a temporary worktree oforigin/master(e8e18e7): with a ZELLE row's edit set to{ type: 'debit' }and another's to{ categories: ['Transfer out', 'Housing'] }, Re-apply to All Transactions gavetransfer:Transfer outfor both.What changed
detectTransfers()(core.js):type. That transaction isn't a candidate in either pass.mark()helper. When the edit hascategories(or an older singlecategory),mark()keeps them. Otherwise it sets Transfer out / Transfer in as before.loadFiles(),reapplyTransferKeywords(),DB.loadAll()and Clear transaction edits all get the fix throughdetectTransfers(). Clear transaction edits empties the edits before it runs detection, so its result is the same as before.undoTransferDetection()is unchanged. It already kept a type you set.Not verified
reapplyTransferKeywords()), fixed in the next PR.transferPairs()(the Transfers screen) andbyCategory()(Spending by category) treat Transfer, Transfer out and Transfer in as transfers whatever the type, andsumExpense()(Money out) treats Transfer that way. So the row stays on the Transfers screen, out of Spending by category, and after a reload out of Money out, until you also change its category. The test logs this as INFO.Automated checks: earlier run, not re-run · 16bacf0
Moved unchanged from this PR's "Test results" comment on 2026-11-04; not re-run, so not in the new table format. Originally a description section titled "How it was tested".
Light checks, by Luis's call to save usage: on this branch's final commit
16bacf0(chained on #45) onlyboot.js,race.jsand this PR's own tests ran. Headless Chromium at 1280×900 againstsamples/, with the pinned CDN libraries served from npm; each script ran asNODE_PATH=$(npm root -g) node <script> <repo> <outdir>.16bacf0boot.jsrace.jstest-transfer-user-type.js(new in this PR)test-drawer-fields.js(#39's, edited in this PR)test-clear-edits.js(#24's, edited in this PR)Full set, once, on the top of the stack (#23,
819e809: every PR below it merged in): every base suite and every fix test from #24 to #50, plus #10's and #23's, each in its final variant. All pass:test-clarity.js55/55,test-insights.js137/137,test-finances.js126/126,test-plan.js127/127,boot.js257 transactions and 0 errors,race.js0 errors; #24–#38's tests (clear-edits 48/48, rebuild-folder 57/57, partial-import 47/47, json-import 28/28, new-browser-copy 10/10, json-export 31/31, plan-links 60/60, rule-flags 67/67, drawer-flags 36/36, start-balance 193/193, ai-summary-period 78/78, account-names 40/40, account-order 32/32, drawer-focus 167/167, cleanup 21/21); #39–#50's tests (drawer-fields 45/45, read-as 52/52, json-import-edits 29/29, overlapping-exports 46/46, override-balance 160/160, card-override 277/277, ai-summary-trend 91/91, transfer-user-type 39/39, untransfer-category 27/27, recategorize 55/55, retype-transfer 135/135, minor-fixes 34/34);test-dbtab.js73/73,test-save-status.js64/64,test-master-port.js16/16. Three scripts needed a test-only change on that run, listed in #23 and in the PRs they belong to; the app code wasn't changed.test-transfer-user-type.jsalso runs on a temporary worktree of the parent commit (the row below, without this fix): 16/16[bug]checks fail there, as expected.test-drawer-fields.jsgot a 600 ms wait after Re-categorize all on the top of the stack (see v1.16.16: Fix the edit drawer freezing a transaction's type and category when you change something else #39).No phone checks (desktop only).
Measured before the chain
The numbers below are the PR author's, on the commit before it was chained (built on the old #38 tip
ecfcab2, v1.16.15, or on the fix below it there; version numbers renumbered to the chain's).Headless Chromium against
samples/, desktop viewport only, one suite at a time.run-tip.sh 15(base suites plus every fix test of #24–#38):renderImportLogrenderImportLograceerrors are expected noise. Every one isrenderImportLog(v1.10.5: fix Import Logs throwing when the view is left before it loads #18's fix isn't in this stack yet). None comes from this change.debit:Other(its CSV values)."zelle" added back: the row typed as Expense stays an expense. It passes 45/45 here and fails on the base (44/45).test-transfer-user-type.jsruns its checks on this branch, then on a temporarygit worktreeof the base (removed afterwards):[bug]fail there, and nothing else.How to reproduce the bug
Run this on the base branch,
fix-ai-summary-trend-range. Master has the bug too.fix-ai-summary-trend-rangeinstead offix-transfer-detection-user-type. Money out starts at −$16,795.07.ZELLE TO M TORRESand open the row dated Oct 16 (−$60.00).xyzin Add keyword and click Add.What goes wrong: the keyword change undoes your edit. The row's Type is Transfer again, and Money out goes back to −$16,795.07 instead of staying at −$16,855.07.
Manual QA steps
Setup
git checkout fix-transfer-detection-user-type.index.htmlfrom the repo. Without a folder, a reload comes back from IndexedDB, which runs transfer detection again. That is the path this PR fixes.samples/and click Import 3 files. The range is set to All time.1. A ZELLE row set to Expense stays an expense after a keyword change
xyzin Add keyword and click Add.Expected:
Before this fix: after the keyword change the row was a Transfer again and Money out went back to −$16,795.07.
2. The same after a reload
Expected:
Before this fix: Type was Transfer again.
3. A category added to a detected transfer survives a reload
xyz2, then go back and look at the row.Expected:
Before this fix: after the reload only Transfer out was left.
4. A retyped leg unpairs its partner at the next reload
Payment Thank Youon Transactions, open the Oct 6 row (+$836.91) and read Type.Expected:
Before this fix: after the reload the autopay was a Transfer again: Transfers 18, Money out −$16,795.07.
5. Bulk Set type is respected too
ZELLE.xyz3.Expected:
Before this fix: Transfer.
6. Re-importing the file keeps the type
samples/checking_sample.csv, click Import 1 file.Expected:
Before this fix: Transfer.
7. Regression: no edits, nothing changes
Expected:
8. Known on this branch alone (fixed by #47)
xyz4(no reload).Expected on this branch:
Please check before merging
https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
Generated by Claude Code