[PR #7111] [MERGED] [AI] Implement sync recovery #14002

Closed
opened 2026-04-10 22:09:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/7111
Author: @MatissJanis
Created: 3/3/2026
Status: Merged
Merged: 3/4/2026
Merged by: @MatissJanis

Base: masterHead: matiss/fix-7026-ios-safari-sync-recovery


📝 Commits (3)

  • 7ff0f6d [AI] Fix iOS/Safari sync recovery (fixes #7026): useOnVisible hook, re-fetch server version on visible, improved network-failure message
  • 842f028 Feedback: coderabbitai
  • c8cff5a Refactor useOnVisible test: remove unnecessary resolve check and simplify callback definition

📊 Changes

7 files changed (+182 additions, -19 deletions)

View changed files

📝 AGENTS.md (+1 -0)
📝 packages/desktop-client/src/components/App.tsx (+8 -18)
📝 packages/desktop-client/src/components/ServerContext.tsx (+11 -0)
📝 packages/desktop-client/src/components/manager/ConfigServer.tsx (+1 -1)
packages/desktop-client/src/hooks/useOnVisible.test.ts (+108 -0)
packages/desktop-client/src/hooks/useOnVisible.ts (+47 -0)
upcoming-release-notes/7111.md (+6 -0)

📄 Description

Description

Update sync server version when browser tab becomes active (ie re-establish connection if it was lost)

Relates to #7026, but does not fix it directly

Testing

Go online. Open app. Go offline. The server shows as offline. Go online again. Server version comes back.

Checklist

  • Release notes added (see link above)
  • No obvious regressions in affected areas
  • Self-review has been performed - I understand what each change in the code does and why it is needed

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 27 14.89 MB → 14.89 MB (+1.01 kB) +0.01%
loot-core 1 5.82 MB 0%
api 1 4.43 MB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
27 14.89 MB → 14.89 MB (+1.01 kB) +0.01%
Changeset
File Δ Size
src/hooks/useOnVisible.ts 🆕 +781 B 0 B → 781 B
src/components/ServerContext.tsx 📈 +443 B (+7.51%) 5.76 kB → 6.19 kB
src/components/manager/ConfigServer.tsx 📈 +79 B (+0.33%) 23.18 kB → 23.26 kB
src/components/App.tsx 📉 -268 B (-2.77%) 9.46 kB → 9.19 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.54 MB → 9.54 MB (+1.01 kB) +0.01%

Smaller
No assets were smaller

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/ca.js 188.11 kB 0%
static/js/da.js 106.35 kB 0%
static/js/de.js 180.07 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/en.js 170.33 kB 0%
static/js/es.js 174.55 kB 0%
static/js/fr.js 179.6 kB 0%
static/js/it.js 171.16 kB 0%
static/js/nb-NO.js 156.96 kB 0%
static/js/nl.js 113.21 kB 0%
static/js/pl.js 88.37 kB 0%
static/js/pt-BR.js 183.19 kB 0%
static/js/th.js 181.87 kB 0%
static/js/uk.js 214.88 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.54 kB 0%
static/js/ReportRouter.js 1.16 MB 0%
static/js/narrow.js 637.77 kB 0%
static/js/TransactionList.js 106.22 kB 0%
static/js/wide.js 164.15 kB 0%
static/js/AppliedFilters.js 9.71 kB 0%
static/js/usePayeeRuleCounts.js 10.04 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.82 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.MNtpiHkH.js 5.82 MB 0%

api

Total

Files count Total bundle size % Changed
1 4.43 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.43 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/7111 **Author:** [@MatissJanis](https://github.com/MatissJanis) **Created:** 3/3/2026 **Status:** ✅ Merged **Merged:** 3/4/2026 **Merged by:** [@MatissJanis](https://github.com/MatissJanis) **Base:** `master` ← **Head:** `matiss/fix-7026-ios-safari-sync-recovery` --- ### 📝 Commits (3) - [`7ff0f6d`](https://github.com/actualbudget/actual/commit/7ff0f6de8a365f3fb32658d9e2a0501c03d9eca2) [AI] Fix iOS/Safari sync recovery (fixes #7026): useOnVisible hook, re-fetch server version on visible, improved network-failure message - [`842f028`](https://github.com/actualbudget/actual/commit/842f0288968ac5438ebfd32d41a238cd896f8f69) Feedback: coderabbitai - [`c8cff5a`](https://github.com/actualbudget/actual/commit/c8cff5aa99d7035751c6b077a4a03fdec074832d) Refactor useOnVisible test: remove unnecessary resolve check and simplify callback definition ### 📊 Changes **7 files changed** (+182 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `AGENTS.md` (+1 -0) 📝 `packages/desktop-client/src/components/App.tsx` (+8 -18) 📝 `packages/desktop-client/src/components/ServerContext.tsx` (+11 -0) 📝 `packages/desktop-client/src/components/manager/ConfigServer.tsx` (+1 -1) ➕ `packages/desktop-client/src/hooks/useOnVisible.test.ts` (+108 -0) ➕ `packages/desktop-client/src/hooks/useOnVisible.ts` (+47 -0) ➕ `upcoming-release-notes/7111.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. --> ## Description <!-- What does this PR do? Why is it needed? Please give context on the "why?": why do we need this change? What problem is it solving for you?--> Update sync server version when browser tab becomes active (ie re-establish connection if it was lost) ## Related issue(s) <!-- e.g. Fixes #123, Relates to #456 --> Relates to #7026, but does not fix it directly ## Testing <!-- What did you test? How can we reproduce the issue you are fixing or how can we test the feature you built? --> Go online. Open app. Go offline. The server shows as offline. Go online again. Server version comes back. ## Checklist - [x] Release notes added (see link above) - [x] No obvious regressions in affected areas - [x] Self-review has been performed - I understand what each change in the code does and why it is needed <!--- actual-bot-sections ---> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 27 | 14.89 MB → 14.89 MB (+1.01 kB) | +0.01% loot-core | 1 | 5.82 MB | 0% api | 1 | 4.43 MB | 0% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 27 | 14.89 MB → 14.89 MB (+1.01 kB) | +0.01% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/hooks/useOnVisible.ts` | 🆕 +781 B | 0 B → 781 B `src/components/ServerContext.tsx` | 📈 +443 B (+7.51%) | 5.76 kB → 6.19 kB `src/components/manager/ConfigServer.tsx` | 📈 +79 B (+0.33%) | 23.18 kB → 23.26 kB `src/components/App.tsx` | 📉 -268 B (-2.77%) | 9.46 kB → 9.19 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.54 MB → 9.54 MB (+1.01 kB) | +0.01% **Smaller** No assets were smaller **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/ca.js | 188.11 kB | 0% static/js/da.js | 106.35 kB | 0% static/js/de.js | 180.07 kB | 0% static/js/en-GB.js | 7.18 kB | 0% static/js/en.js | 170.33 kB | 0% static/js/es.js | 174.55 kB | 0% static/js/fr.js | 179.6 kB | 0% static/js/it.js | 171.16 kB | 0% static/js/nb-NO.js | 156.96 kB | 0% static/js/nl.js | 113.21 kB | 0% static/js/pl.js | 88.37 kB | 0% static/js/pt-BR.js | 183.19 kB | 0% static/js/th.js | 181.87 kB | 0% static/js/uk.js | 214.88 kB | 0% static/js/resize-observer.js | 18.37 kB | 0% static/js/BackgroundImage.js | 120.54 kB | 0% static/js/ReportRouter.js | 1.16 MB | 0% static/js/narrow.js | 637.77 kB | 0% static/js/TransactionList.js | 106.22 kB | 0% static/js/wide.js | 164.15 kB | 0% static/js/AppliedFilters.js | 9.71 kB | 0% static/js/usePayeeRuleCounts.js | 10.04 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.82 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.MNtpiHkH.js | 5.82 MB | 0% </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 4.43 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.43 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-04-10 22:09:59 -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#14002