Skip to content

A local-first personal finance app

Fix balance_current not syncing to API clients after bank sync (#7243)

L. Warren Thompsonf7e9ced9e392
diff --git a/packages/loot-core/src/server/accounts/sync.ts b/packages/loot-core/src/server/accounts/sync.ts
index 306d07e290..2a1b54c66b 100644
--- a/packages/loot-core/src/server/accounts/sync.ts
+++ b/packages/loot-core/src/server/accounts/sync.ts
@@ -68,10 +68,7 @@ function getAccountBalance(account) {
}
async function updateAccountBalance(id: AccountEntity['id'], balance: number) {
- db.runQuery('UPDATE accounts SET balance_current = ? WHERE id = ?', [
- balance,
- id,
- ]);
+ await db.update('accounts', { id, balance_current: balance });
}
async function getAccountOldestTransaction(id): Promise<TransactionEntity> {
diff --git a/upcoming-release-notes/7243.md b/upcoming-release-notes/7243.md
new file mode 100644
index 0000000000..b5b63a2dda
--- /dev/null
+++ b/upcoming-release-notes/7243.md
@@ -0,0 +1,6 @@
+---
+category: Bugfixes
+authors: [lwarrenthompson]
+---
+
+Fix `balance_current` not syncing to API clients after bank sync