Repository navigation
Enable Banking: keep same-day identical rows when the bank sends no ids - #9
Open
richardmuthwill wants to merge 1 commit into
Open
richardmuthwill wants to merge 1 commit into
richardmuthwill wants to merge 1 commit into
Conversation
Swedbank (through Enable Banking) sends transactions with no transaction_id or entry_reference, so broke builds the id from day, amount and text. Two identical rows on one day, like two equal transfers, got the same id. The insert then failed on transactions_plaid_transaction_id_key and the whole sync saved nothing. Repeats now get |2, |3 and so on, as the statement import already does. The first row keeps its id, and same-looking rows are interchangeable, so the ids stay stable from sync to sync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
Swedbank (through Enable Banking) sends transactions with no
transaction_idorentry_reference.ebTxnthen builds the id from day, amount and text. Two identical rows on one day, like two equal transfers to the same account, get the sameplaid_transaction_id.The insert in
saveFeedthen fails ontransactions_plaid_transaction_id_key. The whole sync saves nothing: balances come in, but no transactions, on every sync.Fix
ebFeednow passes its rows throughebUniqueIds. Repeats get|2,|3and so on, the same way the statement import numbers repeats inwithKeys.date_fromis a whole day, so a sync never sees only part of a day's repeats.Checks
node src/lib/providers/feeds.test.ts: added a case with two identical rows and one different row.npx tsc --noEmitandeslinton the changed files.🤖 Generated with Claude Code