[PR #6936] [MERGED] Add refetchOnSync option to useTransactions to refetch when a server sync event is emitted #56133

Closed
opened 2026-05-01 03:44:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/6936
Author: @joel-jeremy
Created: 2/11/2026
Status: Merged
Merged: 2/12/2026
Merged by: @joel-jeremy

Base: masterHead: useTransactions-refetchOnSyncp-option


📝 Commits (5)

  • b9eda70 Migrate setupTests.js to TypeScript with proper types (#6871)
  • 028c25b Delete setupTests PR release note
  • 8d46b57 Add refetchOnSync to useTransactions to refetch when a server sync event is emitted
  • b11d150 Add release note for useTransactions refetchOnSync feature (#6937)
  • c5a212f Coderabbit feedback

📊 Changes

8 files changed (+64 additions, -120 deletions)

View changed files

📝 packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx (+1 -17)
📝 packages/desktop-client/src/components/mobile/accounts/AllAccountTransactions.tsx (+2 -18)
📝 packages/desktop-client/src/components/mobile/accounts/OffBudgetAccountTransactions.tsx (+2 -18)
📝 packages/desktop-client/src/components/mobile/accounts/OnBudgetAccountTransactions.tsx (+2 -18)
📝 packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx (+1 -20)
📝 packages/desktop-client/src/components/mobile/budget/UncategorizedTransactions.tsx (+1 -20)
📝 packages/desktop-client/src/hooks/useTransactions.ts (+49 -9)
upcoming-release-notes/6936.md (+6 -0)

📄 Description

Right now, we have a bunch of component which listen to sync-event and refetch the transaction list whenever it is emitted. This PR puts that duplicated logic to the useTransactions hook and a refetchOnSync options is added to allow disabling that functionality if needed but I think it is good to enable the option by default.


Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 27 14.65 MB → 14.65 MB (-2.83 kB) -0.02%
loot-core 1 5.86 MB 0%
api 1 4.39 MB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
27 14.65 MB → 14.65 MB (-2.83 kB) -0.02%
Changeset
File Δ Size
src/hooks/useTransactions.ts ���� +1.04 kB (+22.73%) 4.58 kB → 5.62 kB
src/components/mobile/accounts/AccountTransactions.tsx 📉 -720 B (-7.18%) 9.79 kB → 9.09 kB
src/components/mobile/accounts/OffBudgetAccountTransactions.tsx 📉 -581 B (-8.78%) 6.46 kB → 5.9 kB
src/components/mobile/accounts/OnBudgetAccountTransactions.tsx 📉 -581 B (-8.80%) 6.45 kB → 5.88 kB
src/components/mobile/accounts/AllAccountTransactions.tsx 📉 -581 B (-9.56%) 5.93 kB → 5.37 kB
src/components/mobile/budget/CategoryTransactions.tsx 📉 -754 B (-12.66%) 5.81 kB → 5.08 kB
src/components/mobile/budget/UncategorizedTransactions.tsx 📉 -745 B (-21.91%) 3.32 kB → 2.59 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 9.48 MB → 9.48 MB (+1.04 kB) +0.01%

Smaller

Asset File Size % Changed
static/js/narrow.js 641.33 kB → 637.46 kB (-3.87 kB) -0.60%

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 12.94 kB 0%
static/js/workbox-window.prod.es5.js 5.64 kB 0%
static/js/da.js 106.62 kB 0%
static/js/de.js 180.44 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/en.js 164.55 kB 0%
static/js/es.js 173.83 kB 0%
static/js/fr.js 179.62 kB 0%
static/js/it.js 171.44 kB 0%
static/js/nb-NO.js 157.23 kB 0%
static/js/nl.js 106.65 kB 0%
static/js/pl.js 88.64 kB 0%
static/js/pt-BR.js 154.57 kB 0%
static/js/sv.js 78.2 kB 0%
static/js/th.js 182.35 kB 0%
static/js/uk.js 215.11 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.54 kB 0%
static/js/ReportRouter.js 1.13 MB 0%
static/js/TransactionList.js 106.13 kB 0%
static/js/wide.js 164.05 kB 0%
static/js/AppliedFilters.js 9.71 kB 0%
static/js/usePayeeRuleCounts.js 10.05 kB 0%
static/js/useTransactionBatchActions.js 13.23 kB 0%
static/js/FormulaEditor.js 1.04 MB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.86 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.DdTXiu5a.js 5.86 MB 0%

api

Total

Files count Total bundle size % Changed
1 4.39 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
bundle.api.js 4.39 MB 0%

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/6936 **Author:** [@joel-jeremy](https://github.com/joel-jeremy) **Created:** 2/11/2026 **Status:** ✅ Merged **Merged:** 2/12/2026 **Merged by:** [@joel-jeremy](https://github.com/joel-jeremy) **Base:** `master` ← **Head:** `useTransactions-refetchOnSyncp-option` --- ### 📝 Commits (5) - [`b9eda70`](https://github.com/actualbudget/actual/commit/b9eda70e8989a5c29534ee1937b4e5398b859966) Migrate setupTests.js to TypeScript with proper types (#6871) - [`028c25b`](https://github.com/actualbudget/actual/commit/028c25bbc5e7d98feaa194bf61d3fe6d49106287) Delete setupTests PR release note - [`8d46b57`](https://github.com/actualbudget/actual/commit/8d46b5778e68660fbf08fb8b2e2ed66ef0886e1f) Add refetchOnSync to useTransactions to refetch when a server sync event is emitted - [`b11d150`](https://github.com/actualbudget/actual/commit/b11d1506d79135114f1a127a9f6bb17bdfea4719) Add release note for useTransactions refetchOnSync feature (#6937) - [`c5a212f`](https://github.com/actualbudget/actual/commit/c5a212f5f556e0d9f01119be63474b0d128c0bff) Coderabbit feedback ### 📊 Changes **8 files changed** (+64 additions, -120 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx` (+1 -17) 📝 `packages/desktop-client/src/components/mobile/accounts/AllAccountTransactions.tsx` (+2 -18) 📝 `packages/desktop-client/src/components/mobile/accounts/OffBudgetAccountTransactions.tsx` (+2 -18) 📝 `packages/desktop-client/src/components/mobile/accounts/OnBudgetAccountTransactions.tsx` (+2 -18) 📝 `packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx` (+1 -20) 📝 `packages/desktop-client/src/components/mobile/budget/UncategorizedTransactions.tsx` (+1 -20) 📝 `packages/desktop-client/src/hooks/useTransactions.ts` (+49 -9) ➕ `upcoming-release-notes/6936.md` (+6 -0) </details> ### 📄 Description <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> Right now, we have a bunch of component which listen to `sync-event` and refetch the transaction list whenever it is emitted. This PR puts that duplicated logic to the `useTransactions` hook and a `refetchOnSync` options is added to allow disabling that functionality if needed but I think it is good to enable the option by default. <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 27 | 14.65 MB → 14.65 MB (-2.83 kB) | -0.02% loot-core | 1 | 5.86 MB | 0% api | 1 | 4.39 MB | 0% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 27 | 14.65 MB → 14.65 MB (-2.83 kB) | -0.02% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/hooks/useTransactions.ts` | ���� +1.04 kB (+22.73%) | 4.58 kB → 5.62 kB `src/components/mobile/accounts/AccountTransactions.tsx` | 📉 -720 B (-7.18%) | 9.79 kB → 9.09 kB `src/components/mobile/accounts/OffBudgetAccountTransactions.tsx` | 📉 -581 B (-8.78%) | 6.46 kB → 5.9 kB `src/components/mobile/accounts/OnBudgetAccountTransactions.tsx` | 📉 -581 B (-8.80%) | 6.45 kB → 5.88 kB `src/components/mobile/accounts/AllAccountTransactions.tsx` | 📉 -581 B (-9.56%) | 5.93 kB → 5.37 kB `src/components/mobile/budget/CategoryTransactions.tsx` | 📉 -754 B (-12.66%) | 5.81 kB → 5.08 kB `src/components/mobile/budget/UncategorizedTransactions.tsx` | 📉 -745 B (-21.91%) | 3.32 kB → 2.59 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 9.48 MB → 9.48 MB (+1.04 kB) | +0.01% **Smaller** Asset | File Size | % Changed ----- | --------- | --------- static/js/narrow.js | 641.33 kB → 637.46 kB (-3.87 kB) | -0.60% **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/indexeddb-main-thread-worker-e59fee74.js | 12.94 kB | 0% static/js/workbox-window.prod.es5.js | 5.64 kB | 0% static/js/da.js | 106.62 kB | 0% static/js/de.js | 180.44 kB | 0% static/js/en-GB.js | 7.18 kB | 0% static/js/en.js | 164.55 kB | 0% static/js/es.js | 173.83 kB | 0% static/js/fr.js | 179.62 kB | 0% static/js/it.js | 171.44 kB | 0% static/js/nb-NO.js | 157.23 kB | 0% static/js/nl.js | 106.65 kB | 0% static/js/pl.js | 88.64 kB | 0% static/js/pt-BR.js | 154.57 kB | 0% static/js/sv.js | 78.2 kB | 0% static/js/th.js | 182.35 kB | 0% static/js/uk.js | 215.11 kB | 0% static/js/resize-observer.js | 18.37 kB | 0% static/js/BackgroundImage.js | 120.54 kB | 0% static/js/ReportRouter.js | 1.13 MB | 0% static/js/TransactionList.js | 106.13 kB | 0% static/js/wide.js | 164.05 kB | 0% static/js/AppliedFilters.js | 9.71 kB | 0% static/js/usePayeeRuleCounts.js | 10.05 kB | 0% static/js/useTransactionBatchActions.js | 13.23 kB | 0% static/js/FormulaEditor.js | 1.04 MB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.86 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.DdTXiu5a.js | 5.86 MB | 0% </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 4.39 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- bundle.api.js | 4.39 MB | 0% </div> </details> </details> <!--- bundlestats-action-comment key:combined end ---> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-01 03:44:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#56133