Skip to content

fix(dedup): scope content hashes by account - #2

Open
smitzo wants to merge 1 commit into
Maxed-OSS:mainfrom
smitzo:agent/fix-cross-account-dedup
Open

fix(dedup): scope content hashes by account#2
smitzo wants to merge 1 commit into
Maxed-OSS:mainfrom
smitzo:agent/fix-cross-account-dedup

Conversation

@smitzo

@smitzo smitzo commented Aug 10, 2026

Copy link
Copy Markdown

Summary

  • scope fallback content hashes by account_id when one is available
  • preserve the existing hash format for transactions without an account ID
  • cover both same-account deduplication and cross-account preservation
  • update the documented fallback identity fields

Root cause

FITID-based deduplication already keys transactions by (account_id, fitid), but the fallback content hash used only date, signed amount, currency, and canonical description. Two transactions from different accounts could therefore receive the same fallback identity and one would be silently discarded during a multi-statement merge.

For example, matching MT940 entries from ACCOUNT-A and ACCOUNT-B previously merged into one row even though both source statements parsed successfully.

Impact

Identical-looking transactions from different known accounts are now preserved. Transactions from the same account continue to deduplicate normally.

Compatibility

The account ID is added to the hash only when present, so existing hashes for CSV, QIF, text, or other account-less transactions remain unchanged. Hashes for account-aware transactions intentionally become account-scoped.

@smitzo
smitzo marked this pull request as ready for review August 10, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant