From a72fd74c5ec2765bc775fa4e9f3d773fb52eac84 Mon Sep 17 00:00:00 2001 From: Alec Bakholdin <43560338+alecbakholdin@users.noreply.github.com> Date: Wed, 26 Feb 2025 19:02:23 -0500 Subject: [PATCH 1/8] Resolves #4429 crash where clicking "manage payees" with an empty payee then clicking dropdown (#4462) * added release notes * only set payee in state on page navigation if payee id is present --------- Co-authored-by: Alec Bakholdin --- .../src/components/transactions/TransactionList.jsx | 2 +- upcoming-release-notes/4462.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 upcoming-release-notes/4462.md diff --git a/packages/desktop-client/src/components/transactions/TransactionList.jsx b/packages/desktop-client/src/components/transactions/TransactionList.jsx index 3bbf25cc328..c404ffbfdc1 100644 --- a/packages/desktop-client/src/components/transactions/TransactionList.jsx +++ b/packages/desktop-client/src/components/transactions/TransactionList.jsx @@ -220,7 +220,7 @@ export function TransactionList({ const onManagePayees = useCallback( id => { - navigate('/payees', { state: { selectedPayee: id } }); + navigate('/payees', id && { state: { selectedPayee: id } }); }, [navigate], ); diff --git a/upcoming-release-notes/4462.md b/upcoming-release-notes/4462.md new file mode 100644 index 00000000000..754d56e9d2b --- /dev/null +++ b/upcoming-release-notes/4462.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [alecbakholdin] +--- + +Fixed bug where navigating to payees page by clicking "manage payees" with an empty payee from a transaction would result in a crash. From 94f94497af17112886cddab49690219ae6a580e6 Mon Sep 17 00:00:00 2001 From: Alec Bakholdin <43560338+alecbakholdin@users.noreply.github.com> Date: Wed, 26 Feb 2025 19:03:50 -0500 Subject: [PATCH 2/8] resets transaction search even if search text is not empty (#4461) * resets transaction search even if search text is not empty * added release notes --------- Co-authored-by: Alec Bakholdin --- packages/loot-core/src/client/data-hooks/transactions.ts | 1 + upcoming-release-notes/4461.md | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 upcoming-release-notes/4461.md diff --git a/packages/loot-core/src/client/data-hooks/transactions.ts b/packages/loot-core/src/client/data-hooks/transactions.ts index 8fc9abf6888..9099f9bae30 100644 --- a/packages/loot-core/src/client/data-hooks/transactions.ts +++ b/packages/loot-core/src/client/data-hooks/transactions.ts @@ -317,6 +317,7 @@ export function useTransactionsSearch({ resetQuery(); setIsSearching(false); } else if (searchText) { + resetQuery(); updateQuery(previousQuery => queries.transactionsSearch(previousQuery, searchText, dateFormat), ); diff --git a/upcoming-release-notes/4461.md b/upcoming-release-notes/4461.md new file mode 100644 index 00000000000..3585daf99ee --- /dev/null +++ b/upcoming-release-notes/4461.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [alecbakholdin] +--- + +Fixed bug where partially erasing search string would not reset search and result in incorrect search results. From 3897a5a51c237a2510c6118f643d59b3c8bb9e9e Mon Sep 17 00:00:00 2001 From: Matt Fiddaman Date: Thu, 27 Feb 2025 01:05:46 +0000 Subject: [PATCH 3/8] fix row spacing on bank sync page (#4458) * fix bank sync row heights * note --- .../desktop-client/src/components/banksync/AccountsList.tsx | 6 +++++- packages/desktop-client/src/components/banksync/index.tsx | 2 +- upcoming-release-notes/4458.md | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 upcoming-release-notes/4458.md diff --git a/packages/desktop-client/src/components/banksync/AccountsList.tsx b/packages/desktop-client/src/components/banksync/AccountsList.tsx index 4bff9360ac4..49469a38e13 100644 --- a/packages/desktop-client/src/components/banksync/AccountsList.tsx +++ b/packages/desktop-client/src/components/banksync/AccountsList.tsx @@ -24,7 +24,11 @@ export function AccountsList({ } return ( - + {accounts.map(account => { const hovered = hoveredAccount === account.id; diff --git a/packages/desktop-client/src/components/banksync/index.tsx b/packages/desktop-client/src/components/banksync/index.tsx index 4526920cad4..1ab3bcea3a7 100644 --- a/packages/desktop-client/src/components/banksync/index.tsx +++ b/packages/desktop-client/src/components/banksync/index.tsx @@ -115,7 +115,7 @@ export function BankSync() { )} {Object.entries(groupedAccounts).map(([syncProvider, accounts]) => { return ( - + {Object.keys(groupedAccounts).length > 1 && ( Date: Wed, 26 Feb 2025 20:17:02 -0500 Subject: [PATCH 4/8] Fix missing space in bank sync strings (#4463) * Fix missing space in string * Add release notes --- .../src/components/modals/CreateAccountModal.tsx | 16 ++++++---------- upcoming-release-notes/4463.md | 6 ++++++ 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 upcoming-release-notes/4463.md diff --git a/packages/desktop-client/src/components/modals/CreateAccountModal.tsx b/packages/desktop-client/src/components/modals/CreateAccountModal.tsx index a753458409c..579be8b00d7 100644 --- a/packages/desktop-client/src/components/modals/CreateAccountModal.tsx +++ b/packages/desktop-client/src/components/modals/CreateAccountModal.tsx @@ -291,11 +291,9 @@ export function CreateAccountModal({ upgradingAccountId }: CreateAccountProps) { Link a European bank account {' '} - to automatically download transactions. - - - GoCardless provides reliable, up-to-date information - from hundreds of banks. + to automatically download transactions. GoCardless + provides reliable, up-to-date information from + hundreds of banks. Link a North American bank account {' '} - to automatically download transactions. - - - SimpleFIN provides reliable, up-to-date information - from hundreds of banks. + to automatically download transactions. SimpleFIN + provides reliable, up-to-date information from + hundreds of banks. diff --git a/upcoming-release-notes/4463.md b/upcoming-release-notes/4463.md new file mode 100644 index 00000000000..269cb823909 --- /dev/null +++ b/upcoming-release-notes/4463.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [jfdoming] +--- + +Add missing space in translation for bank sync From 398ada0afd375a55ceb50993411a8405b9379c95 Mon Sep 17 00:00:00 2001 From: Julian Dominguez-Schatz Date: Thu, 27 Feb 2025 09:16:52 -0500 Subject: [PATCH 5/8] Fix crash when deleting child transactions from an errored split (#4465) * Fix crash when deleting child transactions from an errored split * Add tests * Add release notes * Add graceful fallback Fallback: don't try to show errors on a transaction if it's not actually a split. --- .../transactions/TransactionsTable.jsx | 1 + .../loot-core/src/shared/transactions.test.ts | 19 +++++++++++++++++++ packages/loot-core/src/shared/transactions.ts | 3 ++- upcoming-release-notes/4465.md | 6 ++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 upcoming-release-notes/4465.md diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx index 79dc8a70e66..8312f63b682 100644 --- a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx +++ b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx @@ -1861,6 +1861,7 @@ function TransactionTableInner({ : trans.error; const hasSplitError = + (trans.is_parent || trans.is_child) && (!expanded || isLastChild(transactions, index)) && error && error.type === 'SplitTransactionError'; diff --git a/packages/loot-core/src/shared/transactions.test.ts b/packages/loot-core/src/shared/transactions.test.ts index 7b0c6969723..e083bcb126f 100644 --- a/packages/loot-core/src/shared/transactions.test.ts +++ b/packages/loot-core/src/shared/transactions.test.ts @@ -206,4 +206,23 @@ describe('Transactions', () => { expect.objectContaining({ amount: 3002 }), ]); }); + + test('deleting all child split transactions works', () => { + const transactions = [ + makeTransaction({ amount: 2001 }), + ...makeSplitTransaction( + { id: 't1', amount: 2500, error: splitError(500) }, + [{ id: 't2', amount: 2000 }], + ), + makeTransaction({ amount: 3002 }), + ]; + const { data } = deleteTransaction(transactions, 't2'); + + expect(data).toEqual([ + expect.objectContaining({ amount: 2001 }), + // Must delete error if no children + expect.objectContaining({ amount: 2500, error: null }), + expect.objectContaining({ amount: 3002 }), + ]); + }); }); diff --git a/packages/loot-core/src/shared/transactions.ts b/packages/loot-core/src/shared/transactions.ts index 6142640bce7..afd3b7229c7 100644 --- a/packages/loot-core/src/shared/transactions.ts +++ b/packages/loot-core/src/shared/transactions.ts @@ -282,10 +282,11 @@ export function deleteTransaction( if (trans.id === id) { return null; } else if (trans.subtransactions?.length === 1) { - const { error, subtransactions, ...rest } = trans; + const { subtransactions, ...rest } = trans; return { ...rest, is_parent: false, + error: null, } satisfies TransactionEntity; } else { const sub = trans.subtransactions?.filter(t => t.id !== id); diff --git a/upcoming-release-notes/4465.md b/upcoming-release-notes/4465.md new file mode 100644 index 00000000000..869cc6b2e38 --- /dev/null +++ b/upcoming-release-notes/4465.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [jfdoming] +--- + +Fix crash when deleting child transactions from an errored split From a7cde1f90d3e1a3557d6b6aac606a112399ac6a9 Mon Sep 17 00:00:00 2001 From: youngcw Date: Thu, 27 Feb 2025 10:06:08 -0700 Subject: [PATCH 6/8] fix #4445 (#4468) * change condition * new message * fix * lint --- packages/loot-core/src/server/budget/cleanup-template.ts | 7 ++++++- upcoming-release-notes/4468.md | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 upcoming-release-notes/4468.md diff --git a/packages/loot-core/src/server/budget/cleanup-template.ts b/packages/loot-core/src/server/budget/cleanup-template.ts index 8c1b109212c..7b0dd8536e9 100644 --- a/packages/loot-core/src/server/budget/cleanup-template.ts +++ b/packages/loot-core/src/server/budget/cleanup-template.ts @@ -284,7 +284,7 @@ async function processCleanup(month: string): Promise { } const budgetAvailable = await getSheetValue(sheetName, `to-budget`); - if (budgetAvailable <= 0) { + if (budgetAvailable < 0) { warnings.push('Global: No funds are available to reallocate.'); } @@ -351,6 +351,11 @@ async function processCleanup(month: string): Promise { message: 'Global: Funds not available:', pre: warnings.join('\n\n'), }; + } else if (budgetAvailable === 0) { + return { + type: 'message', + message: 'All categories were up to date.', + }; } else { return { type: 'message', diff --git a/upcoming-release-notes/4468.md b/upcoming-release-notes/4468.md new file mode 100644 index 00000000000..4687a359388 --- /dev/null +++ b/upcoming-release-notes/4468.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [youngcw] +--- + +Remove warning on cleanup templates if budget is already "clean" From 7f50c73866b62cc2c7e3b3078451cb0fcf450435 Mon Sep 17 00:00:00 2001 From: Matt Fiddaman Date: Thu, 27 Feb 2025 17:17:07 +0000 Subject: [PATCH 7/8] fix category group deletion on mobile (#4469) * fix deleting category groups on mobile * note --- .../desktop-client/src/components/mobile/budget/index.tsx | 2 +- upcoming-release-notes/4469.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 upcoming-release-notes/4469.md diff --git a/packages/desktop-client/src/components/mobile/budget/index.tsx b/packages/desktop-client/src/components/mobile/budget/index.tsx index b9a95363cb7..498da1e1d4b 100644 --- a/packages/desktop-client/src/components/mobile/budget/index.tsx +++ b/packages/desktop-client/src/components/mobile/budget/index.tsx @@ -159,7 +159,7 @@ export function Budget() { ); } else { dispatch(collapseModals('category-group-menu')); - dispatch(deleteGroup(groupId)); + dispatch(deleteGroup({ id: groupId })); } }, [categoryGroups, dispatch], diff --git a/upcoming-release-notes/4469.md b/upcoming-release-notes/4469.md new file mode 100644 index 00000000000..c2e4143ec51 --- /dev/null +++ b/upcoming-release-notes/4469.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [matt-fidd] +--- + +Fix category group deletion on mobile From 1c931cf01c868255fff44f8cebd6f9faa9c15a88 Mon Sep 17 00:00:00 2001 From: Matt Fiddaman Date: Thu, 27 Feb 2025 19:41:24 +0000 Subject: [PATCH 8/8] add last bank sync tracking back in (#4472) * add last sync tracking back in * note * type * db.update --- packages/loot-core/src/server/accounts/app.ts | 14 ++++++++++---- upcoming-release-notes/4472.md | 6 ++++++ 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 upcoming-release-notes/4472.md diff --git a/packages/loot-core/src/server/accounts/app.ts b/packages/loot-core/src/server/accounts/app.ts index c9a8ca3c377..d8ee393e7e5 100644 --- a/packages/loot-core/src/server/accounts/app.ts +++ b/packages/loot-core/src/server/accounts/app.ts @@ -628,13 +628,13 @@ type SyncResponse = { updatedAccounts: Array; }; -function handleSyncResponse( +async function handleSyncResponse( res: { added: Array; updated: Array; }, acct: db.DbAccount, -): SyncResponse { +): Promise { const { added, updated } = res; const newTransactions: Array = []; const matchedTransactions: Array = []; @@ -647,6 +647,9 @@ function handleSyncResponse( updatedAccounts.push(acct.id); } + const ts = new Date().getTime().toString(); + await db.update('accounts', { id: acct.id, last_sync: ts }); + return { newTransactions, matchedTransactions, @@ -745,7 +748,7 @@ async function accountsBankSync({ acct.bankId, ); - const syncResponseData = handleSyncResponse(syncResponse, acct); + const syncResponseData = await handleSyncResponse(syncResponse, acct); newTransactions.push(...syncResponseData.newTransactions); matchedTransactions.push(...syncResponseData.matchedTransactions); @@ -848,7 +851,10 @@ async function simpleFinBatchSync({ ), ); } else { - const syncResponseData = handleSyncResponse(syncResponse.res, account); + const syncResponseData = await handleSyncResponse( + syncResponse.res, + account, + ); newTransactions.push(...syncResponseData.newTransactions); matchedTransactions.push(...syncResponseData.matchedTransactions); diff --git a/upcoming-release-notes/4472.md b/upcoming-release-notes/4472.md new file mode 100644 index 00000000000..210b6ae75c0 --- /dev/null +++ b/upcoming-release-notes/4472.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [matt-fidd] +--- + +Add last bank sync tracking back in