diff --git a/packages/loot-core/src/server/accounts/sync.ts b/packages/loot-core/src/server/accounts/sync.ts index 5add734d796..75651164212 100644 --- a/packages/loot-core/src/server/accounts/sync.ts +++ b/packages/loot-core/src/server/accounts/sync.ts @@ -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(', '); @@ -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, }, diff --git a/upcoming-release-notes/4241.md b/upcoming-release-notes/4241.md new file mode 100644 index 00000000000..386e0858515 --- /dev/null +++ b/upcoming-release-notes/4241.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [NullScope] +--- + +Fix GoCardless transaction ID to fallback to it's own generated ID on sync