diff --git a/CHANGELOG.md b/CHANGELOG.md index 39e9a03..5907324 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Backend 0.6.6] - 2026-08-19 + +### Fixed + +- Re-importing an existing operation UUID now safely skips the row even if other source fields changed. + ## [Backend 0.6.5] - 2026-08-19 ### Fixed diff --git a/backend/package.json b/backend/package.json index 3146015..b280c9b 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "@family-budget/backend", - "version": "0.6.5", + "version": "0.6.6", "private": true, "scripts": { "dev": "tsx watch src/app.ts", diff --git a/backend/src/services/import.ts b/backend/src/services/import.ts index 5169804..1f7a1fe 100644 --- a/backend/src/services/import.ts +++ b/backend/src/services/import.ts @@ -226,7 +226,7 @@ export async function importStatement( `INSERT INTO transactions (account_id, operation_id, operation_at, amount_signed, commission, description, direction, fingerprint, category_id, is_category_confirmed, import_id) VALUES ($1, COALESCE($2::uuid, gen_random_uuid()), $3, $4, $5, $6, $7, $8, $9, $10, $11) - ON CONFLICT (account_id, fingerprint) DO NOTHING + ON CONFLICT DO NOTHING RETURNING id`, [accountId, tx.operationId ?? null, tx.operationAt, tx.amountSigned, tx.commission, tx.description, dir, fp, categoryId, isCategoryConfirmed, importId], );