[PR #4161] [MERGED] Update global event listeners to handle sync server and DB update sync events #58878

Closed
opened 2026-05-06 23:40:16 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/4161
Author: @joel-jeremy
Created: 1/15/2025
Status: Merged
Merged: 1/22/2025
Merged by: @joel-jeremy

Base: masterHead: update-global-event-listeners


📝 Commits (3)

📊 Changes

12 files changed (+100 additions, -119 deletions)

View changed files

📝 eslint.config.mjs (+6 -0)
📝 packages/desktop-client/src/components/App.tsx (+6 -1)
📝 packages/desktop-client/src/components/budget/index.tsx (+2 -31)
📝 packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx (+0 -5)
📝 packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx (+0 -5)
📝 packages/desktop-client/src/components/mobile/budget/index.tsx (+1 -18)
📝 packages/desktop-client/src/components/payees/ManagePayeesWithData.tsx (+0 -1)
📝 packages/desktop-client/src/global-events.ts (+45 -50)
📝 packages/desktop-client/src/index.tsx (+0 -4)
📝 packages/desktop-client/src/redux/index.ts (+7 -1)
📝 packages/loot-core/src/client/shared-listeners.ts (+27 -3)
upcoming-release-notes/4161.md (+6 -0)

📄 Description

Fixes https://github.com/actualbudget/actual/issues/4082

The global-listeners file listens to a bunch of events from the backend (i.e. service worker). One of these events is the sync-event this event is emitted whenever new messages are received from the sync server (type: 'success') or whenever a DB update is made (type: 'applied'). This change updates the sync-event handler so that it handles both success and applied sync event types - what this means is that whenever Actual received sync messages from the sync server or whenever a DB update is made, the payees, categories, and accounts in the redux state are automatically updated.

This will also help with performance by removing some of the duplicate sync-event listeners resulting in less DB calls


🔄 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/4161 **Author:** [@joel-jeremy](https://github.com/joel-jeremy) **Created:** 1/15/2025 **Status:** ✅ Merged **Merged:** 1/22/2025 **Merged by:** [@joel-jeremy](https://github.com/joel-jeremy) **Base:** `master` ← **Head:** `update-global-event-listeners` --- ### 📝 Commits (3) - [`c3c9b5e`](https://github.com/actualbudget/actual/commit/c3c9b5e44bd31b32adb9c0cd62750d6444af1d5f) Update global event listeners - [`1b8cf86`](https://github.com/actualbudget/actual/commit/1b8cf8651ad6d3cef82a5846d3d6cec0f03b7e06) Release notes - [`41ffffa`](https://github.com/actualbudget/actual/commit/41ffffacedebefa121faad5f4b0e5c75f59a1e55) Fix lint error ### 📊 Changes **12 files changed** (+100 additions, -119 deletions) <details> <summary>View changed files</summary> 📝 `eslint.config.mjs` (+6 -0) 📝 `packages/desktop-client/src/components/App.tsx` (+6 -1) 📝 `packages/desktop-client/src/components/budget/index.tsx` (+2 -31) 📝 `packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx` (+0 -5) 📝 `packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx` (+0 -5) 📝 `packages/desktop-client/src/components/mobile/budget/index.tsx` (+1 -18) 📝 `packages/desktop-client/src/components/payees/ManagePayeesWithData.tsx` (+0 -1) 📝 `packages/desktop-client/src/global-events.ts` (+45 -50) 📝 `packages/desktop-client/src/index.tsx` (+0 -4) 📝 `packages/desktop-client/src/redux/index.ts` (+7 -1) 📝 `packages/loot-core/src/client/shared-listeners.ts` (+27 -3) ➕ `upcoming-release-notes/4161.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 --> Fixes https://github.com/actualbudget/actual/issues/4082 The `global-listeners` file listens to a bunch of events from the backend (i.e. service worker). One of these events is the `sync-event` this event is emitted whenever new messages are received from the sync server (`type: 'success'`) or whenever a DB update is made (`type: 'applied'`). This change updates the `sync-event` handler so that it handles both `success` and `applied` sync event types - what this means is that whenever Actual received sync messages from the sync server or whenever a DB update is made, the payees, categories, and accounts in the redux state are automatically updated. This will also help with performance by removing some of the duplicate `sync-event` listeners resulting in less DB calls --- <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-06 23:40:16 -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#58878