Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#2495): fix GoCardless transaction ID to fallback to it's own generated ID on sync #4241

Merged
merged 10 commits into from
Feb 5, 2025
8 changes: 7 additions & 1 deletion packages/loot-core/src/server/accounts/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,12 @@ async function normalizeBankSyncTransactions(transactions, acctId) {

trans.cleared = Boolean(trans.booked);

let imported_id = trans.transactionId;

if (trans.cleared && !trans.transactionId && trans.internalTransactionId) {
imported_id = `${trans.account}-${trans.internalTransactionId}`;
}

const notes =
trans.remittanceInformationUnstructured ||
(trans.remittanceInformationUnstructuredArray || []).join(', ');
Expand All @@ -364,7 +370,7 @@ async function normalizeBankSyncTransactions(transactions, acctId) {
date: trans.date,
notes: notes.trim().replace('#', '##'),
category: trans.category ?? null,
imported_id: trans.transactionId,
imported_id,
imported_payee: trans.imported_payee,
cleared: trans.cleared,
},
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/4241.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [NullScope]
---

Fix GoCardless transaction ID to fallback to it's own generated ID on sync