Repository navigation
v1.8.1: fix Chase re-import duplicating rows in IndexedDB - #2
Merged
Merged
Conversation
DB.importTransactions() assigned the _2/_3 occurrence suffix whenever an ID already existed, so every re-uploaded Chase row was inserted again as _2 (165 -> 330 in testing). Suffixes are now assigned once in parseCsvFile(), counted within the file, so IDs are final and identical in memory and in IndexedDB; the import skips IDs already stored (one getAllKeys read). Each import also removes leftover copies from the bug: suffixed rows whose base is in the file but whose exact ID is not. The results card reports them. Identical Ally rows are dropped in memory too; custom schemas without a time column get suffixes by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AT1Bh6Sscb8ogzzuf8U3Jc
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AT1Bh6Sscb8ogzzuf8U3Jc
1 of 2 tasks
…import-duplicates Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AT1Bh6Sscb8ogzzuf8U3Jc
This was referenced Oct 24, 2026
5 tasks done
Owner
Author
Review: manual test of
|
| # | Test | Expected | Result |
|---|---|---|---|
| 1 | First import (Settings → Import → Pick CSV Files, assigned to Chase) | 165 new, 0 skipped | ✅ Pass |
| 2 | Reload (F5) and boot from IndexedDB | Still 165 transactions | ✅ Pass (Settings → General → Danger Zone shows 165) |
| 3 | Re-import the same file, then reload | 0 new, 165 skipped; still 165 after reload (master doubles to 330) |
✅ Pass |
| 4 | Identical same-day rows are kept | SJ PARKING METER, Aug 14, −$2.00 appears exactly twice |
✅ Pass |
| 5 | Console errors during imports and reload | No red errors | ✅ Pass |
Not tested yet
- Real data: I haven't re-imported my real Chase CSVs to confirm the cleanup of leftover duplicates ("N leftover duplicate copies removed").
Note for future testing
The Transactions view only shows the selected date range, and it defaults to This Month. Set it to All Time before checking counts or searching for older rows like the Aug 14 pair. Settings → General → Danger Zone shows the total count regardless of the range.
Verdict
Fix works as described on the sample data. Approval pending the real-data re-import.
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
Re-importing a Chase CSV no longer duplicates every Chase row in IndexedDB. Each import now also removes the extra copies the bug already created. Released as v1.8.1.
The bug
DB.importTransactions()assigned the_2/_3occurrence suffix whenever an ID already existed in the database.…_2. In testing, 165 Chase rows became 330 after a single re-import.finlens-state.json. The in-memory list is rebuilt from the CSVs on import._2. Overrides couldn't target the second copy reliably.The fix (
068a2c6)parseCsvFile()assigns suffixes, counting identical rows within the file: the first keeps the base hash, the second gets_2. They pass throughnormalizeRow(..., occurrence)tomkTx(), so IDs are final and identical in memory, in IndexedDB and intxOverrides.DB.importTransactions()skips IDs it already holds. It reads the stored keys once withgetAllKeys(), and no longer suffixes on collision or logs a console error per skipped row.timecolumn now get suffixes by default instead of losing same-day identical rows.Docs (
a4d123a)How it was tested
A headless Chromium run with the sample CSVs. 18/18 new checks pass, and the v1.8.0 suite still passes 27/27.
_2._2copies of 20 rows, a bogus_3of the identical pair, and an unrelated suffixed row from "another file"):_2row survives a re-import._2row (1 inserted, 164 skipped).After merging
If your real database was affected, re-import your Chase CSVs once. The results card will show how many leftover copies were removed.
Noticed, not changed
Console error on reload: "Canvas is already in use" can appear for the Overview charts after a page reload. This already happens on the base branch: two overview renders run back to back during boot, and their deferred chart setups collide. The charts still render. It belongs in its own small fix.
Generated by Claude Code